Skip to content

Commit

Permalink
Add a test for initialization of internal iterator for related object…
Browse files Browse the repository at this point in the history
… collection getter fix #460
  • Loading branch information
kigeia authored and willdurand committed Dec 29, 2012
1 parent a51850a commit 758448d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@ public function testManyToManyGetter()
$this->assertEquals(1, count($books), 'getCrossRefFK() accepts a query as first parameter');
}

public function testOneToManyGetter()
{
BookstoreDataPopulator::populate(null, true);
$author = AuthorQuery::create()->findOneByLastName('Grass');
$books = $author->getBooks(new Criteria());
$this->assertNotNull($books->getCurrent(), 'getRelCol() initialize the internal iterator at the beginning');
}

public function testManyToManyCounterExists()
{
$this->assertTrue(method_exists('BookClubList', 'countBooks'), 'Object generator correcly adds counter for the crossRefFk');
Expand Down

0 comments on commit 758448d

Please sign in to comment.