From 30f46537d4c506cdbbf5d08950687f532ca2f677 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Wed, 5 Aug 2015 15:35:33 +0100 Subject: [PATCH] Added the error message to the failure cases. This makes it much easier to debug what goes wrong, en-masse. --- tests/utils/tools.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/utils/tools.php b/tests/utils/tools.php index 0e647b287..cabd7e6aa 100644 --- a/tests/utils/tools.php +++ b/tests/utils/tools.php @@ -243,13 +243,13 @@ function throws($function, $exceptionname, $infunction = null) { if (strcasecmp($function, $infunction) == 0) { printf("OK: Got %s thrown from %s\n", $exceptionname, $infunction); } else { - printf("ALMOST: Got %s - but was thrown in %s, not %s\n", $exceptionname, $function, $infunction); + printf("ALMOST: Got %s - but was thrown in %s, not %s (%s)\n", $exceptionname, $function, $infunction, $e->getMessage()); } return $e->getMessage(); } printf("OK: Got %s\n", $exceptionname); } else { - printf("ALMOST: Got %s - expected %s\n", get_class($e), $exceptionname); + printf("ALMOST: Got %s - expected %s: %s\n", get_class($e), $exceptionname, $e->getMessage()); } return $e->getMessage(); }