Skip to content

Commit

Permalink
test: add groupBy mapping test
Browse files Browse the repository at this point in the history
  • Loading branch information
klarkent committed Oct 16, 2018
1 parent bb5536f commit 6d659d4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/MappableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ public function mapped_select()
$this->assertEquals($sql, $query->toSql());
}

/**
* @test
*/
public function mapped_groupBy()
{
$sql = 'select count(*) as aggregate from "users" '.
'group by "profile"."first_name", "profile"."age", "ign"';

$model = $this->getModel();
$model->getConnection()->shouldReceive('select')->once()->with($sql, [], m::any())->andReturn([]);

$model->groupBy('first_name', 'age', 'nick')->count();
}

/**
* @test
*
Expand Down

0 comments on commit 6d659d4

Please sign in to comment.