$this->
assertEquals(4,
$query_result, 'Returned the correct number of rows.'
);
} /**
* Tests distinct queries.
*/
public function testDistinct() { $query =
$this->connection->
select('test_task'
);
$query->
addField('test_task', 'task'
);
$query->
orderBy('task'
);
$query->
distinct();
$query_result =
$query->
execute()->
fetchAll(\PDO::FETCH_COLUMN
);
$expected_result =
['code', 'eat', 'found new band', 'perform at superbowl', 'sing', 'sleep'
];
$this->
assertEquals($query_result,
$expected_result, 'Returned the correct result.'
);
} /**
* Tests that we can generate a count query from a built query.
*/
public function testCountQuery() { $query =
$this->connection->
select('test'
);