From 0086d17afe35b7fae57a31922444cb839f36eb35 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Fri, 25 Dec 2015 15:10:21 +0100 Subject: [PATCH 1/2] Common 2.6 compatibility Internal structure of the ArrayCache has changed, therefore we should fix the tests depending on it instead --- .../Doctrine/Tests/ORM/Functional/QueryCacheTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php b/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php index cf35d8617..039bb1655 100644 --- a/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php @@ -105,16 +105,16 @@ class QueryCacheTest extends \Doctrine\Tests\OrmFunctionalTestCase $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); - $cache = new \Doctrine\Common\Cache\ArrayCache(); + $cache = $this->getMock('Doctrine\Common\Cache\Cache'); $query->setQueryCacheDriver($cache); - $users = $query->getResult(); + $cache + ->expects(self::once()) + ->method('save') + ->with(self::isType('string'), self::isInstanceOf('Doctrine\ORM\Query\ParserResult')); - $data = $this->cacheDataReflection->getValue($cache); - $this->assertEquals(1, count($data)); - - $this->assertInstanceOf('Doctrine\ORM\Query\ParserResult', array_pop($data)); + $query->getResult(); } public function testQueryCache_HitDoesNotSaveParserResult() From 27a5284899fd291b5e81d0a0a856da08e758d5b5 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Fri, 25 Dec 2015 15:20:35 +0100 Subject: [PATCH 2/2] doctrine/common 2.6.0 compat Less strict assertion - no need to check the exact file name --- tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php index 405260185..99e436ae8 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php @@ -49,7 +49,7 @@ abstract class AbstractDriverTest extends \PHPUnit_Framework_TestCase { $this->setExpectedException( 'Doctrine\Common\Persistence\Mapping\MappingException', - "No mapping file found named '".$this->dir."/Foo".$this->getFileExtension()."' for class 'MyNamespace\MySubnamespace\Entity\Foo'." + "No mapping file found named" ); $driver = $this->getDriver(array(