Test that we can generate a count query from a query with distinct.
function testCountQueryDistinct() {
$query = db_select('test_task');
$task_field = $query
->addField('test_task', 'task');
$query
->distinct();
$count = $query
->countQuery()
->execute()
->fetchField();
$this
->assertEqual($count, 6, 'Counted the correct number of records.');
}