Skip to content

Commit fdfbdb1

Browse files
derickrjmikola
authored andcommitted
Added the error message to the failure cases.
This makes it much easier to debug what goes wrong, en-masse.
1 parent 36fa7a7 commit fdfbdb1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/utils/tools.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,13 @@ function throws($function, $exceptionname, $infunction = null) {
243243
if (strcasecmp($function, $infunction) == 0) {
244244
printf("OK: Got %s thrown from %s\n", $exceptionname, $infunction);
245245
} else {
246-
printf("ALMOST: Got %s - but was thrown in %s, not %s\n", $exceptionname, $function, $infunction);
246+
printf("ALMOST: Got %s - but was thrown in %s, not %s (%s)\n", $exceptionname, $function, $infunction, $e->getMessage());
247247
}
248248
return $e->getMessage();
249249
}
250250
printf("OK: Got %s\n", $exceptionname);
251251
} else {
252-
printf("ALMOST: Got %s - expected %s\n", get_class($e), $exceptionname);
252+
printf("ALMOST: Got %s - expected %s: %s\n", get_class($e), $exceptionname, $e->getMessage());
253253
}
254254
return $e->getMessage();
255255
}

0 commit comments

Comments
 (0)