@@ 344-355 (lines=12) @@ | ||
341 | /** |
|
342 | * @group DDC-2504 |
|
343 | */ |
|
344 | public function testContainsOnOneToManyJoinedInheritanceWillNotCauseQueriesWhenNonPersistentItemIsMatched() |
|
345 | { |
|
346 | $otherClass = $this->_em->find(DDC2504OtherClass::class, $this->ddc2504OtherClassId); |
|
347 | $queryCount = $this->getCurrentQueryCount(); |
|
348 | ||
349 | $this->assertFalse($otherClass->childClasses->contains(new DDC2504ChildClass())); |
|
350 | $this->assertEquals( |
|
351 | $queryCount, |
|
352 | $this->getCurrentQueryCount(), |
|
353 | 'Checking for contains of new entity should cause no query to be executed.' |
|
354 | ); |
|
355 | } |
|
356 | ||
357 | /** |
|
358 | * @group DDC-2504 |
|
@@ 571-584 (lines=14) @@ | ||
568 | /** |
|
569 | * @group DDC-2504 |
|
570 | */ |
|
571 | public function testRemovalOfNonManagedElementFromOneToManyJoinedInheritanceCollectionDoesNotInitializeIt() |
|
572 | { |
|
573 | /* @var $otherClass DDC2504OtherClass */ |
|
574 | $otherClass = $this->_em->find(DDC2504OtherClass::class, $this->ddc2504OtherClassId); |
|
575 | $queryCount = $this->getCurrentQueryCount(); |
|
576 | ||
577 | $otherClass->childClasses->removeElement(new DDC2504ChildClass()); |
|
578 | ||
579 | $this->assertEquals( |
|
580 | $queryCount, |
|
581 | $this->getCurrentQueryCount(), |
|
582 | 'Removing an unmanaged entity should cause no query to be executed.' |
|
583 | ); |
|
584 | } |
|
585 | ||
586 | /** |
|
587 | * @group DDC-2504 |