We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3ec914b + 7dbeab5 commit ac2cef7Copy full SHA for ac2cef7
1 file changed
src/PHPUnit/Listeners/NaughtyTestListener.php
@@ -205,10 +205,14 @@ private function formatValue($value)
205
try {
206
$encoded = json_encode($value, true);
207
if (json_last_error() !== 0) {
208
- $encoded = sprintf('Object<%s>', get_class($value));
+ throw new \Exception(json_last_error_msg());
209
}
210
} catch (Exception $exception) {
211
+ if (is_object($value)) {
212
+ $encoded = sprintf('Object<%s>', get_class($value));
213
+ } else {
214
+ $encoded = gettype($value);
215
+ }
216
217
218
0 commit comments