Verified Commit 8c27634a authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2795919 by daffie, rpayanm: Change SelectComplexTest::testDistinct to...

Issue #2795919 by daffie, rpayanm: Change SelectComplexTest::testDistinct to test the distinct values not the count

(cherry picked from commit 4df74826)
parent 463dbb6b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -184,10 +184,12 @@ public function testRangeUndo() {
  public function testDistinct() {
    $query = $this->connection->select('test_task');
    $query->addField('test_task', 'task');
    $query->orderBy('task');
    $query->distinct();
    $query_result = $query->countQuery()->execute()->fetchField();
    $query_result = $query->execute()->fetchAll(\PDO::FETCH_COLUMN);

    $this->assertEquals(6, $query_result, 'Returned the correct number of rows.');
    $expected_result = ['code', 'eat', 'found new band', 'perform at superbowl', 'sing', 'sleep'];
    $this->assertEquals($query_result, $expected_result, 'Returned the correct result.');
  }

  /**