Skip to content

Commit abab1c8

Browse files
authored
Show a pretty diff for assertExactJson() (#38655)
1 parent eb378fc commit abab1c8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Illuminate/Testing/AssertableJsonString.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ public function assertExact(array $data)
9696

9797
$expected = $this->reorderAssocKeys($data);
9898

99-
PHPUnit::assertEquals(json_encode($expected), json_encode($actual));
99+
PHPUnit::assertEquals(
100+
json_encode($expected, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES),
101+
json_encode($actual, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)
102+
);
100103

101104
return $this;
102105
}

0 commit comments

Comments
 (0)