1
0
mirror of synced 2025-01-19 15:01:40 +03:00

#1245 DDC-2504 - extracting test:

Removing a managed item from a one-to-many extra-lazy association to a JTI does not initialize the collection
This commit is contained in:
Marco Pivetta 2015-01-12 21:43:37 +01:00
parent ec08286173
commit 25d40caf1e

View File

@ -511,7 +511,29 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
} }
/** /**
* * @group DDC-2504
*/
public function testRemovalOfManagedElementFromOneToManyJoinedInheritanceCollectionDoesNotInitializeIt()
{
$otherClass = $this->_em->find(DDC2504OtherClass::CLASSNAME, $this->ddc2504OtherClassId);
$childClass = $this->_em->find(DDC2504ChildClass::CLASSNAME, $this->ddc2504ChildClassId);
$queryCount = $this->getCurrentQueryCount();
$otherClass->childClasses->removeElement($childClass);
$this->assertFalse($otherClass->childClasses->isInitialized(), 'Collection is not initialized.');
$this->assertEquals(
$queryCount + 2,
$this->getCurrentQueryCount(),
'One removal per table in the JTI has been executed'
);
$this->assertFalse($otherClass->childClasses->contains($childClass));
}
/**
* @group DDC-2504
*/ */
public function testRemoveElementOneToManyJoinedInheritance() public function testRemoveElementOneToManyJoinedInheritance()
{ {