1
0
mirror of synced 2025-01-31 12:32:59 +03:00

#1245 DDC-2504 - splitting test method into a test about count() and one about contains() on a lazy persistent collection

This commit is contained in:
Marco Pivetta 2015-01-12 21:34:12 +01:00
parent 8d287b17d7
commit 7a0cb1c370

View File

@ -369,9 +369,18 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
$this->assertFalse($otherClass->childClasses->contains($childClass)); $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->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."); $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->assertEquals(2, count($otherClass->childClasses));
$this->assertFalse($otherClass->childClasses->isInitialized());
} }
/** /**