File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,9 @@ public function inject(Collection $collection)
31
31
*/
32
32
public function dump ($ vars )
33
33
{
34
- $ this ->dump = array_merge ($ this ->dump , $ vars );
34
+ $ this ->dump [] = count ($ vars ) == 1
35
+ ? $ vars [0 ]
36
+ : $ vars ;
35
37
}
36
38
37
39
/**
Original file line number Diff line number Diff line change @@ -25,6 +25,24 @@ public function it_can_dump_var_via_helper()
25
25
]);
26
26
}
27
27
28
+ /** @test */
29
+ public function it_can_dump_multiple_vars ()
30
+ {
31
+ $ this ->app ['router ' ]->get ('foo ' , function () {
32
+ lad ('baz1 ' , 'baz2 ' );
33
+
34
+ return response ()->json (['foo ' => 'bar ' ]);
35
+ });
36
+
37
+ $ this ->json ('get ' , '/foo ' )
38
+ ->assertStatus (200 )
39
+ ->assertJsonFragment ([
40
+ 'dump ' => [
41
+ ['baz1 ' , 'baz2 ' ],
42
+ ]
43
+ ]);
44
+ }
45
+
28
46
/** @test */
29
47
public function it_can_dump_query ()
30
48
{
You can’t perform that action at this time.
0 commit comments