1
0
mirror of synced 2024-12-14 23:26:04 +03:00

Test actual data returned by get()

This commit is contained in:
Sander Marechal 2013-06-20 10:18:08 +02:00
parent 3555007f08
commit 647c5e2cad

View File

@ -527,10 +527,11 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
$queryCount = $this->getCurrentQueryCount(); $queryCount = $this->getCurrentQueryCount();
$user->articles->get($this->articleId); $article = $user->articles->get($this->articleId);
$this->assertFalse($user->articles->isInitialized()); $this->assertFalse($user->articles->isInitialized());
$this->assertEquals($queryCount + 1, $this->getCurrentQueryCount()); $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount());
$this->assertSame($article, $this->_em->find('Doctrine\Tests\Models\CMS\CmsArticle', $this->articleId));
} }
/** /**
@ -543,10 +544,11 @@ class ExtraLazyCollectionTest extends \Doctrine\Tests\OrmFunctionalTestCase
$queryCount = $this->getCurrentQueryCount(); $queryCount = $this->getCurrentQueryCount();
$user->groups->get($this->groupId); $group = $user->groups->get($this->groupId);
$this->assertFalse($user->groups->isInitialized()); $this->assertFalse($user->groups->isInitialized());
$this->assertEquals($queryCount + 1, $this->getCurrentQueryCount()); $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount());
$this->assertSame($group, $this->_em->find('Doctrine\Tests\Models\CMS\CmsGroup', $this->groupId));
} }
/** /**