Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public function testPaginationWithSimpleArithmetic() |
||
22 | { |
||
23 | $article = new CmsArticle(); |
||
24 | |||
25 | $article->topic = 'Test SimpleArithmetic ORDER BY'; |
||
26 | $article->text = 'This test fails on MySQL.'; |
||
27 | $article->version = 1; |
||
28 | |||
29 | $this->_em->persist($article); |
||
30 | $this->_em->flush(); |
||
31 | |||
32 | $query = $this->_em->createQuery('SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a ORDER BY a.version + 0 ASC'); |
||
33 | $query->setFirstResult(0); |
||
34 | $query->setMaxResults(1); |
||
35 | |||
36 | $paginator = new Paginator($query, true); |
||
37 | $paginator->setUseOutputWalkers(false); |
||
38 | $this->assertEquals(1, count(iterator_to_array($paginator))); |
||
39 | } |
||
41 |