From 1c8ae505570c603868b2cb1b53e9ddbcca4cbb41 Mon Sep 17 00:00:00 2001 From: Austin Morris Date: Mon, 22 Jul 2013 18:54:02 -0400 Subject: [PATCH] do not initialize coll on add() --- lib/Doctrine/ORM/PersistentCollection.php | 2 -- .../Tests/ORM/PersistentCollectionFunctionalTest.php | 9 --------- 2 files changed, 11 deletions(-) diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index 462c23ec7..8d0fef757 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -587,8 +587,6 @@ final class PersistentCollection implements Collection, Selectable */ public function add($value) { - $this->initialize(); - $this->coll->add($value); $this->changed(); diff --git a/tests/Doctrine/Tests/ORM/PersistentCollectionFunctionalTest.php b/tests/Doctrine/Tests/ORM/PersistentCollectionFunctionalTest.php index 5206a70d7..fbce752f7 100644 --- a/tests/Doctrine/Tests/ORM/PersistentCollectionFunctionalTest.php +++ b/tests/Doctrine/Tests/ORM/PersistentCollectionFunctionalTest.php @@ -35,15 +35,6 @@ class PersistentCollectionFunctionalTest extends OrmFunctionalTestCase $this->collection->setOwner(new ECommerceCart(), $classMetaData->getAssociationMapping('products')); } - /** - * Test that PersistentCollection::add() initializes the collection. - */ - public function testAddInitializesCollection() - { - $this->collection->add(new ECommerceProduct); - $this->assertTrue($this->collection->isInitialized()); - } - /** * Test that PersistentCollection::current() initializes the collection. */