1
0
mirror of synced 2025-02-20 22:23:14 +03:00

Verifying that count on the lazy criteria collection is cached even with 0 count

This commit is contained in:
Marco Pivetta 2014-05-17 18:51:33 +02:00
parent c46b63f6b4
commit 546bb53ef9

View File

@ -47,4 +47,13 @@ class LazyCriteriaCollectionTest extends PHPUnit_Framework_TestCase
$this->assertSame(10, $this->lazyCriteriaCollection->count());
$this->assertSame(10, $this->lazyCriteriaCollection->count());
}
public function testCountIsCachedEvenWithZeroResult()
{
$this->persister->expects($this->once())->method('count')->with($this->criteria)->will($this->returnValue(0));
$this->assertSame(0, $this->lazyCriteriaCollection->count());
$this->assertSame(0, $this->lazyCriteriaCollection->count());
$this->assertSame(0, $this->lazyCriteriaCollection->count());
}
}