useModelSet('ddc117'); parent::setUp(); $this->_em->createQuery('DELETE FROM Doctrine\Tests\Models\DDC117\DDC117ArticleDetails ad')->execute(); $article = new DDC117Article("Foo"); $this->_em->persist($article); $this->_em->flush(); $articleDetails = new DDC117ArticleDetails($article, "Very long text"); $this->_em->persist($articleDetails); $this->_em->flush(); $dql = "SELECT ad FROM Doctrine\Tests\Models\DDC117\DDC117ArticleDetails ad"; $query = $this->_em->createQuery($dql); $this->paginator = new Paginator($query); } public function testPaginateCount() { $this->assertEquals(1, count($this->paginator)); } public function testPaginateIterate() { foreach ($this->paginator as $ad) { $this->assertInstanceOf('Doctrine\Tests\Models\DDC117\DDC117ArticleDetails', $ad); } } public function testPaginateCountNoOutputWalkers() { $this->paginator->setUseOutputWalkers(false); $this->assertEquals(1, count($this->paginator)); } public function testPaginateIterateNoOutputWalkers() { $this->paginator->setUseOutputWalkers(false); $this->setExpectedException('RuntimeException', 'Paginating an entity with foreign key as identifier only works when using the Output Walkers. Call Paginator#setUseOutputWalkers(true) before iterating the paginator.'); foreach ($this->paginator as $ad) { $this->assertInstanceOf('Doctrine\Tests\Models\DDC117\DDC117ArticleDetails', $ad); } } }