File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,19 @@ public function it_returns_all_records_when_no_parameters_is_passed()
25
25
]);
26
26
}
27
27
28
+ /** @test */
29
+ public function it_returns_zero_filtered_records_on_empty_collection ()
30
+ {
31
+ $ crawler = $ this ->call ('GET ' , '/collection/empty ' );
32
+ $ crawler ->assertExactJson ([
33
+ "data " => [],
34
+ "draw " => 0 ,
35
+ "input " => [],
36
+ 'recordsTotal ' => 0 ,
37
+ 'recordsFiltered ' => 0 ,
38
+ ]);
39
+ }
40
+
28
41
/** @test */
29
42
public function it_can_perform_global_search ()
30
43
{
@@ -242,5 +255,9 @@ protected function setUp(): void
242
255
$ this ->app ['router ' ]->get ('/collection/users ' , function (DataTables $ datatables ) {
243
256
return $ datatables ->collection (User::all ())->toJson ();
244
257
});
258
+
259
+ $ this ->app ['router ' ]->get ('/collection/empty ' , function (DataTables $ datatables ) {
260
+ return $ datatables ->collection ([])->toJson ();
261
+ });
245
262
}
246
263
}
You can’t perform that action at this time.
0 commit comments