@@ -1197,19 +1197,21 @@ public function testFindListSelectedFields()
1197
1197
$ expected = ['id ' , 'username ' ];
1198
1198
$ this ->assertSame ($ expected , $ query ->clause ('select ' ));
1199
1199
1200
- $ select = ['odd ' => new QueryExpression ('id % 2 ' )];
1201
- $ query = $ table ->find ('list ' , ['groupField ' => 'odd ' ])
1202
- ->select ($ select )
1203
- ->order ('id ' );
1204
- $ expected = array_merge (['id ' , 'username ' ], $ select );
1205
- $ this ->assertSame ($ expected , $ query ->clause ('select ' ));
1206
-
1207
1200
$ expected = ['odd ' => new QueryExpression ('id % 2 ' ), 'id ' , 'username ' ];
1208
1201
$ query = $ table ->find ('list ' , [
1209
1202
'fields ' => $ expected ,
1210
1203
'groupField ' => 'odd ' ,
1211
1204
]);
1212
1205
$ this ->assertSame ($ expected , $ query ->clause ('select ' ));
1206
+
1207
+ $ articles = new Table ([
1208
+ 'table ' => 'articles ' ,
1209
+ 'connection ' => $ this ->connection ,
1210
+ ]);
1211
+
1212
+ $ query = $ articles ->find ('list ' , ['groupField ' => 'author_id ' ]);
1213
+ $ expected = ['id ' , 'title ' , 'author_id ' ];
1214
+ $ this ->assertSame ($ expected , $ query ->clause ('select ' ));
1213
1215
}
1214
1216
1215
1217
/**
@@ -1229,7 +1231,6 @@ public function testFindListWithVirtualField()
1229
1231
$ query = $ table
1230
1232
->find ('list ' )
1231
1233
->order ('id ' );
1232
-
1233
1234
$ this ->assertEmpty ($ query ->clause ('select ' ));
1234
1235
1235
1236
$ expected = [
@@ -1239,6 +1240,9 @@ public function testFindListWithVirtualField()
1239
1240
4 => 'bonus '
1240
1241
];
1241
1242
$ this ->assertSame ($ expected , $ query ->toArray ());
1243
+
1244
+ $ query = $ table ->find ('list ' , ['groupField ' => 'odd ' ]);
1245
+ $ this ->assertEmpty ($ query ->clause ('select ' ));
1242
1246
}
1243
1247
1244
1248
/**
0 commit comments