From 3d9cb9460a4380289c0c27c9129dfcafa45d32ef Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Wed, 13 Feb 2013 08:46:37 +0100 Subject: [PATCH] Fix test failing when memcache extension is installed, but memcache server isnt. --- tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php index 7e6e200d9..94936a125 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php @@ -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 {