HHVM: Prevent E_WARNING messages by Redis test in console output.

This commit is contained in:
Andreas Fischer 2015-01-14 14:46:22 +01:00
parent 3a6d2fcc10
commit 567c246094

View file

@ -16,7 +16,17 @@ class Redis extends Cache {
if (!\OC\Memcache\Redis::isAvailable()) {
self::markTestSkipped('The redis extension is not available.');
}
set_error_handler(
function($errno, $errstr) {
restore_error_handler();
self::markTestSkipped($errstr);
},
E_WARNING
);
$instance = new \OC\Memcache\Redis(self::getUniqueID());
restore_error_handler();
if ($instance->set(self::getUniqueID(), self::getUniqueID()) === false) {
self::markTestSkipped('redis server seems to be down.');
}