Added a failing test case on PersistentCollection::matching() when collection is not initialized and there are NEW entities in the collection
This commit is contained in:
parent
ab990cfba6
commit
4b3ecfe674
@ -173,6 +173,30 @@ class OneToManyBidirectionalAssociationTest extends \Doctrine\Tests\OrmFunctiona
|
||||
$this->assertInstanceOf('Doctrine\Common\Collections\Collection', $results);
|
||||
$this->assertEquals(2, count($results));
|
||||
}
|
||||
|
||||
public function testMatchingBis()
|
||||
{
|
||||
$this->_createFixture();
|
||||
|
||||
$product = $this->_em->find('Doctrine\Tests\Models\ECommerce\ECommerceProduct', $this->product->getId());
|
||||
$features = $product->getFeatures();
|
||||
|
||||
$thirdFeature = new ECommerceFeature();
|
||||
$thirdFeature->setDescription('Third feature');
|
||||
$product->addFeature($thirdFeature);
|
||||
|
||||
$results = $features->matching(new Criteria(
|
||||
Criteria::expr()->eq('description', 'Third feature')
|
||||
));
|
||||
|
||||
$this->assertInstanceOf('Doctrine\Common\Collections\Collection', $results);
|
||||
$this->assertEquals(1, count($results));
|
||||
|
||||
$results = $features->matching(new Criteria());
|
||||
|
||||
$this->assertInstanceOf('Doctrine\Common\Collections\Collection', $results);
|
||||
$this->assertEquals(3, count($results));
|
||||
}
|
||||
|
||||
private function _createFixture()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user