diff --git a/tests/Doctrine/ODM/MongoDB/Tests/Functional/AtomicSetTest.php b/tests/Doctrine/ODM/MongoDB/Tests/Functional/AtomicSetTest.php index ed01055b39..3289d98bdd 100644 --- a/tests/Doctrine/ODM/MongoDB/Tests/Functional/AtomicSetTest.php +++ b/tests/Doctrine/ODM/MongoDB/Tests/Functional/AtomicSetTest.php @@ -162,9 +162,8 @@ public function testAtomicCollectionReplacedAndUpdated(): void $this->assertCount(1, $this->logger, 'Inserting a document with an embed-many collection requires one query'); $this->dm->clear(); - $user = $this->dm->getRepository(get_class($user))->find($user->id); - $user->phonenumbers = new ArrayCollection(); - $user->phonenumbers[] = new Phonenumber('87654321'); + $user = $this->dm->getRepository(get_class($user))->find($user->id); + $user->phonenumbers = new ArrayCollection([new Phonenumber('87654321')]); $this->logger->clear(); $this->dm->flush(); $this->assertCount(1, $this->logger, 'Updating emptied collection requires one query');