From 5fa6b2110039670b2cd0504b95d54a79b272a299 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 8 Mar 2015 15:14:27 +0100 Subject: test: Fail on exceptions If we don't output a test plan prove will consider the test failed. The destructor would run when an uncaught exception is thrown so don't use a destructor to output the testplan. Signed-off-by: Florian Pritz --- application/controllers/tools.php | 1 + application/tests/Test.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/application/controllers/tools.php b/application/controllers/tools.php index e36b09b79..e226b1815 100644 --- a/application/controllers/tools.php +++ b/application/controllers/tools.php @@ -82,5 +82,6 @@ class Tools extends MY_Controller { $test->cleanup(); } } + $test->done_testing(); } } diff --git a/application/tests/Test.php b/application/tests/Test.php index e18aa9374..1f2e4fefa 100644 --- a/application/tests/Test.php +++ b/application/tests/Test.php @@ -102,7 +102,7 @@ abstract class Test { { } - public function __destruct() + public function done_testing() { $this->t->done_testing(); } -- cgit v1.2.3-24-g4f1b