File tree Expand file tree Collapse file tree
tests/system/Database/Live Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -254,33 +254,34 @@ public function testFirst()
254254 public function provideGroupBy ()
255255 {
256256 return [
257- [true ],
258- [false ],
257+ [
258+ true ,
259+ 3 ,
260+ ],
261+ [
262+ false ,
263+ 7 ,
264+ ],
259265 ];
260266 }
261267
262268 /**
263269 * @dataProvider provideGroupBy
264270 */
265- public function testFirstAggregate ($ groupBy )
271+ public function testFirstAggregate ($ groupBy, $ total )
266272 {
267273 $ model = new UserModel ();
268274
269275 if ($ groupBy )
270276 {
271- $ user = $ model ->select ('SUM(id) as total ' )
272- ->where ('id > ' , 2 )
273- ->groupBy ('id ' )
274- ->first ();
275- $ this ->assertEquals (3 , $ user ->total );
276- }
277- else
278- {
279- $ user = $ model ->select ('SUM(id) as total ' )
280- ->where ('id > ' , 2 )
281- ->first ();
282- $ this ->assertEquals (7 , $ user ->total );
277+ $ model ->groupBy ('id ' );
283278 }
279+
280+ $ user = $ model ->select ('SUM(id) as total ' )
281+ ->where ('id > ' , 2 )
282+ ->first ();
283+
284+ $ this ->assertEquals ($ total , $ user ->total );
284285 }
285286
286287 //--------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments