public static function setUpBeforeClass() { if (!\OC\Memcache\Memcached::isAvailable()) { self::markTestSkipped('The memcached extension is not available.'); } $instance = new \OC\Memcache\Memcached(uniqid()); if ($instance->set(uniqid(), uniqid()) === false) { self::markTestSkipped('memcached server seems to be down.'); } }
/** * check if there is a memcache backend available * * @return bool */ public function isAvailable() { return XCache::isAvailable() || APCu::isAvailable() || APC::isAvailable() || Memcached::isAvailable(); }