diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-15 09:45:55 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-15 09:45:55 +0000 |
commit | b5e6f79f5fec0709e6eeab4f5813f9c60dbec431 (patch) | |
tree | 7ac979b67f0748860a70041e7e8070417d4bb3b4 /modules | |
parent | 7b5713d485b5e9cfb0537e66a365998ef3775e57 (diff) |
Reapply patch to make tests always call teardown.
Upstream ticket:
http://dev.kohanaphp.com/ticket/960
Diffstat (limited to 'modules')
-rw-r--r-- | modules/unit_test/libraries/Unit_Test.php | 13 |
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 |