|
@@ 353-364 (lines=12) @@
|
| 350 |
|
/** |
| 351 |
|
* @group DDC-2504 |
| 352 |
|
*/ |
| 353 |
|
public function testContainsOnOneToManyJoinedInheritanceWillNotCauseQueriesWhenNonPersistentItemIsMatched() |
| 354 |
|
{ |
| 355 |
|
$otherClass = $this->em->find(DDC2504OtherClass::class, $this->ddc2504OtherClassId); |
| 356 |
|
$queryCount = $this->getCurrentQueryCount(); |
| 357 |
|
|
| 358 |
|
self::assertFalse($otherClass->childClasses->contains(new DDC2504ChildClass())); |
| 359 |
|
self::assertEquals( |
| 360 |
|
$queryCount, |
| 361 |
|
$this->getCurrentQueryCount(), |
| 362 |
|
'Checking for contains of new entity should cause no query to be executed.' |
| 363 |
|
); |
| 364 |
|
} |
| 365 |
|
|
| 366 |
|
/** |
| 367 |
|
* @group DDC-2504 |
|
@@ 580-593 (lines=14) @@
|
| 577 |
|
/** |
| 578 |
|
* @group DDC-2504 |
| 579 |
|
*/ |
| 580 |
|
public function testRemovalOfNonManagedElementFromOneToManyJoinedInheritanceCollectionDoesNotInitializeIt() |
| 581 |
|
{ |
| 582 |
|
/* @var $otherClass DDC2504OtherClass */ |
| 583 |
|
$otherClass = $this->em->find(DDC2504OtherClass::class, $this->ddc2504OtherClassId); |
| 584 |
|
$queryCount = $this->getCurrentQueryCount(); |
| 585 |
|
|
| 586 |
|
$otherClass->childClasses->removeElement(new DDC2504ChildClass()); |
| 587 |
|
|
| 588 |
|
self::assertEquals( |
| 589 |
|
$queryCount, |
| 590 |
|
$this->getCurrentQueryCount(), |
| 591 |
|
'Removing an unmanaged entity should cause no query to be executed.' |
| 592 |
|
); |
| 593 |
|
} |
| 594 |
|
|
| 595 |
|
/** |
| 596 |
|
* @group DDC-2504 |