File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public function extension(): string
29
29
public function match ($ expected , $ actual )
30
30
{
31
31
if (is_array ($ actual )) {
32
- $ actual = json_encode ($ data , JSON_PRETTY_PRINT ).PHP_EOL ;
32
+ $ actual = json_encode ($ actual , JSON_PRETTY_PRINT ).PHP_EOL ;
33
33
}
34
34
35
35
Assert::assertJsonStringEqualsJsonString ($ expected , $ actual );
Original file line number Diff line number Diff line change @@ -41,6 +41,14 @@ public function can_match_a_json_snapshot()
41
41
$ this ->assertMatchesJsonSnapshot ($ data );
42
42
}
43
43
44
+ /** @test */
45
+ public function can_match_an_array_snapshot ()
46
+ {
47
+ $ data = ['foo ' => 'foo ' , 'bar ' => 'bar ' , 'baz ' => 'baz ' ];
48
+
49
+ $ this ->assertMatchesJsonSnapshot ($ data );
50
+ }
51
+
44
52
/** @test */
45
53
public function can_match_a_file_hash_snapshot ()
46
54
{
You can’t perform that action at this time.
0 commit comments