Fix test failing when memcache extension is installed, but memcache server isnt.
This commit is contained in:
parent
719031f2ef
commit
3d9cb9460a
@ -15,7 +15,7 @@ class DDC742Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
if (\extension_loaded('memcache')) {
|
||||
if (\extension_loaded('memcache') && @fsockopen('localhost', 11211)) {
|
||||
$memcache = new \Memcache();
|
||||
$memcache->addServer('localhost');
|
||||
$memcache->flush();
|
||||
@ -26,6 +26,8 @@ class DDC742Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$this->_em->getMetadataFactory()->setCacheDriver($cacheDriver);
|
||||
} else if (\extension_loaded('apc')) {
|
||||
$this->_em->getMetadataFactory()->setCacheDriver(new \Doctrine\Common\Cache\ApcCache());
|
||||
} else {
|
||||
$this->markTestSkipped('Test only works with a cache enabled.');
|
||||
}
|
||||
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user