summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-15 09:45:55 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-15 09:45:55 +0000
commitb5e6f79f5fec0709e6eeab4f5813f9c60dbec431 (patch)
tree7ac979b67f0748860a70041e7e8070417d4bb3b4
parent7b5713d485b5e9cfb0537e66a365998ef3775e57 (diff)
Reapply patch to make tests always call teardown.
Upstream ticket: http://dev.kohanaphp.com/ticket/960
-rw-r--r--modules/unit_test/libraries/Unit_Test.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/unit_test/libraries/Unit_Test.php b/modules/unit_test/libraries/Unit_Test.php
index e6010d3c..54366cb7 100644
--- a/modules/unit_test/libraries/Unit_Test.php
+++ b/modules/unit_test/libraries/Unit_Test.php
@@ -136,8 +136,12 @@ class Unit_Test_Core {
$object->setup();
}
- // Run the actual test
- $object->$method_name();
+ $e = null;
+ try {
+
+ // Run the actual test
+ $object->$method_name();
+ } catch (Exception $e) { }
// Run teardown method
if ($teardown === TRUE)
@@ -145,6 +149,11 @@ class Unit_Test_Core {
$object->teardown();
}
+ if ($e) {
+ throw $e;
+ }
+
+
$this->stats[$class]['total']++;
// Test passed