Skip to content

Commit 413d3bf

Browse files
committed
Group multiple values in dump
1 parent 465ba30 commit 413d3bf

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/Storage.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ public function inject(Collection $collection)
3131
*/
3232
public function dump($vars)
3333
{
34-
$this->dump = array_merge($this->dump, $vars);
34+
$this->dump[] = count($vars) == 1
35+
? $vars[0]
36+
: $vars;
3537
}
3638

3739
/**

tests/DebuggerTest.php

+18
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,24 @@ public function it_can_dump_var_via_helper()
2525
]);
2626
}
2727

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+
2846
/** @test */
2947
public function it_can_dump_query()
3048
{

0 commit comments

Comments
 (0)