1
0
mirror of synced 2025-03-23 16:33:54 +03:00

Verifying that count on the lazy criteria collection is cached

This commit is contained in:
Marco Pivetta 2014-05-17 18:51:01 +02:00
parent 81fbb049a5
commit c46b63f6b4

View File

@ -36,6 +36,15 @@ class LazyCriteriaCollectionTest extends PHPUnit_Framework_TestCase
{
$this->persister = $this->getMock('Doctrine\ORM\Persisters\EntityPersister');
$this->criteria = new Criteria();
$this->$lazyCriteriaCollection = new LazyCriteriaCollection($this->persister, $this->criteria);
$this->lazyCriteriaCollection = new LazyCriteriaCollection($this->persister, $this->criteria);
}
public function testCountIsCached()
{
$this->persister->expects($this->once())->method('count')->with($this->criteria)->will($this->returnValue(10));
$this->assertSame(10, $this->lazyCriteriaCollection->count());
$this->assertSame(10, $this->lazyCriteriaCollection->count());
$this->assertSame(10, $this->lazyCriteriaCollection->count());
}
}