Exemplo n.º 1
0
 public function testSelectDistinct()
 {
     $this->deleteTestingRows('testFirstResult1');
     $this->deleteTestingRows('testFirstResult2');
     $this->createTestingRows('testFirstResult1');
     $this->createTestingRows('testFirstResult2');
     $this->queryBuilder->selectDistinct('appid');
     $this->queryBuilder->from('*PREFIX*appconfig')->where($this->queryBuilder->expr()->in('appid', [$this->queryBuilder->expr()->literal('testFirstResult1'), $this->queryBuilder->expr()->literal('testFirstResult2')]))->orderBy('appid', 'DESC');
     $query = $this->queryBuilder->execute();
     $rows = $query->fetchAll();
     $query->closeCursor();
     $this->assertEquals([['appid' => 'testFirstResult2'], ['appid' => 'testFirstResult1']], $rows);
     $this->deleteTestingRows('testFirstResult1');
     $this->deleteTestingRows('testFirstResult2');
 }