1
0
mirror of synced 2025-02-03 05:49:25 +03:00

changes after code review

This commit is contained in:
Oliver Tischlinger 2015-09-25 10:44:30 +02:00
parent 03523c67d5
commit 60beca3760
2 changed files with 8 additions and 1 deletions

View File

@ -93,7 +93,7 @@ class LazyCriteriaCollection extends AbstractLazyCollection implements Selectabl
return $this->collection->isEmpty(); return $this->collection->isEmpty();
} }
return $this->count() == 0; return !$this->count();
} }
/** /**

View File

@ -111,6 +111,13 @@ class LazyCriteriaCollectionTest extends PHPUnit_Framework_TestCase
$this->assertTrue($this->lazyCriteriaCollection->isEmpty()); $this->assertTrue($this->lazyCriteriaCollection->isEmpty());
} }
public function testIsEmptyIsFalseIfCountIsNotZero()
{
$this->persister->expects($this->once())->method('count')->with($this->criteria)->will($this->returnValue(1));
$this->assertFalse($this->lazyCriteriaCollection->isEmpty());
}
public function testIsEmptyUsesWrappedCollectionWhenInitialized() public function testIsEmptyUsesWrappedCollectionWhenInitialized()
{ {
$this $this