From 7a0cb1c370e9546981376b3b7da5197921b6a196 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Mon, 12 Jan 2015 21:34:12 +0100 Subject: [PATCH] #1245 DDC-2504 - splitting test method into a test about `count()` and one about `contains()` on a lazy persistent collection --- .../Tests/ORM/Functional/ExtraLazyCollectionTest.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php index 5b5f1bd51..90479ca39 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php @@ -369,9 +369,18 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase $this->assertFalse($otherClass->childClasses->contains($childClass)); $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Checking for contains of managed entity (but not persisted) should cause no query to be executed."); $this->assertFalse($otherClass->childClasses->isInitialized(), "Post-Condition: Collection is not initialized."); + } + + /** + * @group DDC-2504 + */ + public function testCountingOnOneToManyJoinedInheritanceWillNotInitializeCollection() + { + $otherClass = $this->_em->find('Doctrine\Tests\Models\DDC2504\DDC2504OtherClass', $this->ddc2504OtherClassId); - $this->assertFalse($otherClass->childClasses->isInitialized(), "Pre-Condition"); $this->assertEquals(2, count($otherClass->childClasses)); + + $this->assertFalse($otherClass->childClasses->isInitialized()); } /**