Merge branch 'hotfix/#1510-DDC-3908-fix-cache-related-tests-in-2.5' into 2.5
Close #1510
This commit is contained in:
commit
2d1bc78749
@ -45,12 +45,12 @@ class QueryCacheTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
$query->setQueryCacheDriver($cache);
|
$query->setQueryCacheDriver($cache);
|
||||||
|
|
||||||
$query->getResult();
|
$query->getResult();
|
||||||
$this->assertEquals(2, $this->getCacheSize($cache));
|
$this->assertEquals(1, $this->getCacheSize($cache));
|
||||||
|
|
||||||
$query->setHint('foo', 'bar');
|
$query->setHint('foo', 'bar');
|
||||||
|
|
||||||
$query->getResult();
|
$query->getResult();
|
||||||
$this->assertEquals(3, $this->getCacheSize($cache));
|
$this->assertEquals(2, $this->getCacheSize($cache));
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ class QueryCacheTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
$users = $query->getResult();
|
$users = $query->getResult();
|
||||||
|
|
||||||
$data = $this->cacheDataReflection->getValue($cache);
|
$data = $this->cacheDataReflection->getValue($cache);
|
||||||
$this->assertEquals(2, count($data));
|
$this->assertEquals(1, count($data));
|
||||||
|
|
||||||
$this->assertInstanceOf('Doctrine\ORM\Query\ParserResult', array_pop($data));
|
$this->assertInstanceOf('Doctrine\ORM\Query\ParserResult', array_pop($data));
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ class ResultCacheTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
|
|
||||||
$this->assertEquals(0, $this->getCacheSize($cache));
|
$this->assertEquals(0, $this->getCacheSize($cache));
|
||||||
$query->getResult();
|
$query->getResult();
|
||||||
$this->assertEquals(2, $this->getCacheSize($cache));
|
$this->assertEquals(1, $this->getCacheSize($cache));
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
@ -343,18 +343,18 @@ class SQLFilterTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
|||||||
$query->setQueryCacheDriver($cache);
|
$query->setQueryCacheDriver($cache);
|
||||||
|
|
||||||
$query->getResult();
|
$query->getResult();
|
||||||
$this->assertEquals(2, sizeof($cacheDataReflection->getValue($cache)));
|
$this->assertEquals(1, sizeof($cacheDataReflection->getValue($cache)));
|
||||||
|
|
||||||
$conf = $this->_em->getConfiguration();
|
$conf = $this->_em->getConfiguration();
|
||||||
$conf->addFilter("locale", "\Doctrine\Tests\ORM\Functional\MyLocaleFilter");
|
$conf->addFilter("locale", "\Doctrine\Tests\ORM\Functional\MyLocaleFilter");
|
||||||
$this->_em->getFilters()->enable("locale");
|
$this->_em->getFilters()->enable("locale");
|
||||||
|
|
||||||
$query->getResult();
|
$query->getResult();
|
||||||
$this->assertEquals(3, sizeof($cacheDataReflection->getValue($cache)));
|
$this->assertEquals(2, sizeof($cacheDataReflection->getValue($cache)));
|
||||||
|
|
||||||
// Another time doesn't add another cache entry
|
// Another time doesn't add another cache entry
|
||||||
$query->getResult();
|
$query->getResult();
|
||||||
$this->assertEquals(3, sizeof($cacheDataReflection->getValue($cache)));
|
$this->assertEquals(2, sizeof($cacheDataReflection->getValue($cache)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testQueryGeneration_DependsOnFilters()
|
public function testQueryGeneration_DependsOnFilters()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user