Conditions | 2 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | public function testIterate() |
||
14 | { |
||
15 | $article = new \Doctrine\Tests\Models\CMS\CmsArticle(); |
||
16 | $article->text = "foo"; |
||
17 | $article->topic = "bar"; |
||
18 | |||
19 | $article2 = new \Doctrine\Tests\Models\CMS\CmsArticle(); |
||
20 | $article2->text = "bar"; |
||
21 | $article2->topic = "foo"; |
||
22 | |||
23 | $this->_em->persist($article); |
||
24 | $this->_em->persist($article2); |
||
25 | $this->_em->flush(); |
||
26 | $this->_em->clear(); |
||
27 | |||
28 | $it = $this->_em->createQueryBuilder() |
||
29 | ->from('Doctrine\Tests\Models\CMS\CmsArticle', 'a') |
||
30 | ->select('a.text') |
||
31 | ->getQuery() |
||
32 | ->iterate(); |
||
33 | |||
34 | foreach ($it as $row) { |
||
35 | $this->assertArrayHasKey(0, $row); |
||
36 | } |
||
39 |