Merge pull request #6244 from owncloud/memcached-connectivity-tests
Only run memcached tests if server is available.
This commit is contained in:
commit
28180485d9
|
@ -10,11 +10,17 @@
|
||||||
namespace Test\Memcache;
|
namespace Test\Memcache;
|
||||||
|
|
||||||
class Memcached extends Cache {
|
class Memcached extends Cache {
|
||||||
public function setUp() {
|
static public function setUpBeforeClass() {
|
||||||
if (!\OC\Memcache\Memcached::isAvailable()) {
|
if (!\OC\Memcache\Memcached::isAvailable()) {
|
||||||
$this->markTestSkipped('The memcached extension is not available.');
|
self::markTestSkipped('The memcached extension is not available.');
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
$instance = new \OC\Memcache\Memcached(uniqid());
|
||||||
|
if ($instance->set(uniqid(), uniqid()) === false) {
|
||||||
|
self::markTestSkipped('memcached server seems to be down.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setUp() {
|
||||||
$this->instance = new \OC\Memcache\Memcached(uniqid());
|
$this->instance = new \OC\Memcache\Memcached(uniqid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue