Skip to content

Commit 58bef45

Browse files
Cast arrays to json during comparison
1 parent 15d9bef commit 58bef45

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Drivers/JsonDriver.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ public function extension(): string
2828

2929
public function match($expected, $actual)
3030
{
31+
if (is_array($actual)) {
32+
$actual = json_encode($data, JSON_PRETTY_PRINT).PHP_EOL;
33+
}
34+
3135
Assert::assertJsonStringEqualsJsonString($expected, $actual);
3236
}
3337
}

0 commit comments

Comments
 (0)