Exemple #1
0
 /**
  * @dataProvider dataFirstResult
  *
  * @param int $firstResult
  * @param array $expectedSet
  */
 public function testFirstResult($firstResult, $expectedSet)
 {
     $this->deleteTestingRows();
     $this->createTestingRows();
     if ($firstResult !== null) {
         $this->queryBuilder->setFirstResult($firstResult);
         // FIXME Remove this once Doctrine/DBAL is >2.5.1:
         // FIXME See https://github.com/doctrine/dbal/pull/782
         $this->queryBuilder->setMaxResults(100);
     }
     $this->assertSame($firstResult, $this->queryBuilder->getFirstResult());
     $rows = $this->getTestingRows($this->queryBuilder);
     $this->assertCount(sizeof($expectedSet), $rows);
     $this->assertEquals($expectedSet, $rows);
     $this->deleteTestingRows();
 }