コード例 #1
0
 public function testPopulateRelationOneToManyWithEmptyCollection()
 {
     $author = new Author();
     $author->setLastName('I who never wrote');
     $author->save($this->con);
     AuthorPeer::clearInstancePool();
     BookPeer::clearInstancePool();
     $coll = new PropelObjectCollection();
     $coll->setFormatter(new PropelObjectFormatter(new ModelCriteria(null, 'Author')));
     $coll[] = $author;
     $books = $coll->populateRelation('Book', null, $this->con);
     $this->assertEquals(0, $books->count());
     $count = $this->con->getQueryCount();
     $this->assertEquals(0, $author->countBooks());
     $this->assertEquals($count, $this->con->getQueryCount());
 }