From 45e1817f6f4a5a2decee630c099f02f25c00488a Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 13 Jul 2017 16:39:06 +0200 Subject: [PATCH] Add test for removing element not in collection --- tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php index 7f18aaca0..e7f4fd298 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php @@ -645,6 +645,8 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase $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."); + $this->assertFalse($user->groups->removeElement($group), "Removing an already removed element returns false"); + // Test Many to Many removal with Entity state as new $group = new CmsGroup(); $group->name = "A New group!";