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
2929 public function match ($ expected , $ actual )
3030 {
3131 if (is_array ($ actual )) {
32- $ actual = json_encode ($ data , JSON_PRETTY_PRINT ).PHP_EOL ;
32+ $ actual = json_encode ($ actual , JSON_PRETTY_PRINT ).PHP_EOL ;
3333 }
3434
3535 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()
4141 $ this ->assertMatchesJsonSnapshot ($ data );
4242 }
4343
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+
4452 /** @test */
4553 public function can_match_a_file_hash_snapshot ()
4654 {
You can’t perform that action at this time.
0 commit comments