1
0
mirror of synced 2025-02-02 13:31:45 +03:00

Fix return of removeElement on collections

Fixes #5745
This commit is contained in:
Andreas Braun 2017-07-13 08:16:00 +02:00 committed by Marco Pivetta
parent c06f19db8d
commit 7c1ebd99bc
No known key found for this signature in database
GPG Key ID: 4167D3337FD9D629
2 changed files with 2 additions and 6 deletions

View File

@ -375,11 +375,7 @@ final class PersistentCollection extends AbstractLazyCollection implements Selec
$persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association);
if ($persister->removeElement($this, $element)) {
return $element;
}
return null;
return $persister->removeElement($this, $element);
}
$removed = parent::removeElement($element);

View File

@ -636,7 +636,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase
$group = $this->_em->find('Doctrine\Tests\Models\CMS\CmsGroup', $this->groupId);
$queryCount = $this->getCurrentQueryCount();
$user->groups->removeElement($group);
$this->assertTrue($user->groups->removeElement($group));
$this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Removing a persisted entity should cause one query to be executed.");
$this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized.");