Skip to content

Commit

Permalink
clean up testFirstAggregate
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Apr 30, 2020
1 parent 0d272bb commit c01f554
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/system/Database/Live/ModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,19 @@ public function testFirstAggregate($groupBy)

if ($groupBy)
{
$user = $model->select('SUM(id) as total')
->where('id >', 2)
->groupBy('id')
->first();
$model->groupBy('id');
}

$user = $model->select('SUM(id) as total')
->where('id >', 2)
->first();

if ($groupBy)
{
$this->assertEquals(3, $user->total);
}
else
{
$user = $model->select('SUM(id) as total')
->where('id >', 2)
->first();
$this->assertEquals(7, $user->total);
}
}
Expand Down

0 comments on commit c01f554

Please sign in to comment.