From 75e5c40a50e2f8fc7147d4df44bb285df6ac3023 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Wed, 22 Sep 2010 23:01:08 +0200 Subject: [PATCH] DDC-742 - More tests on the issue about possible caching problem, could not verify however --- .../Tests/ORM/Functional/Ticket/DDC742Test.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php index 3c19e0f3f..ad6585449 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php @@ -11,6 +11,13 @@ class DDC742Test extends \Doctrine\Tests\OrmFunctionalTestCase protected function setUp() { parent::setUp(); + + if (\extension_loaded('memcache')) { + $this->_em->getMetadataFactory()->setCacheDriver(new \Doctrine\Common\Cache\MemcacheCache()); + } else if (\extension_loaded('apc')) { + $this->_em->getMetadataFactory()->setCacheDriver(new \Doctrine\Common\Cache\ApcCache()); + } + try { $this->_schemaTool->createSchema(array( $this->_em->getClassMetadata(__NAMESPACE__ . '\DDC742User'), @@ -19,6 +26,10 @@ class DDC742Test extends \Doctrine\Tests\OrmFunctionalTestCase } catch(\Exception $e) { } + + // make sure classes will be deserialized from caches + $this->_em->getMetadataFactory()->setMetadataFor(__NAMESPACE__ . '\DDC742User', null); + $this->_em->getMetadataFactory()->setMetadataFor(__NAMESPACE__ . '\DDC742Comment', null); } public function testIssue()