diff --git a/tests/MappableTest.php b/tests/MappableTest.php index d1c6570..8be150f 100644 --- a/tests/MappableTest.php +++ b/tests/MappableTest.php @@ -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 *