Skip to content

Commit 9b71490

Browse files
committed
Added test for VarDumper
1 parent 3513cae commit 9b71490

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

tests/Feature/RayTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function test_log()
2929

3030
ray(true, false);
3131

32-
ray($this);
32+
ray(ray());
3333

3434
ray(['a' => 1, 'b' => ['c' => 3]]);
3535

tests/Feature/VarDumperTest.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace Tests\Feature;
5+
6+
use Symfony\Component\VarDumper\VarDumper;
7+
use Tests\TestCase;
8+
9+
class VarDumperTest extends TestCase
10+
{
11+
protected function setUp(): void
12+
{
13+
parent::setUp();
14+
15+
ray()->disable();
16+
17+
VarDumper::setHandler();
18+
$_SERVER['VAR_DUMPER_FORMAT'] = 'server';
19+
}
20+
21+
function test_dump()
22+
{
23+
dump('Hello', 'World');
24+
25+
dump(['an array']);
26+
27+
dump(true, false);
28+
29+
dump(ray());
30+
31+
dump(['a' => 1, 'b' => ['c' => 3]]);
32+
33+
$this->assertTrue(true);
34+
}
35+
36+
function test_exception()
37+
{
38+
try {
39+
throw new \Exception('Something went wrong');
40+
} catch(\Exception $e) {
41+
dump($e);
42+
}
43+
44+
$this->assertTrue(true);
45+
}
46+
}

0 commit comments

Comments
 (0)