summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-03-24 10:19:30 +0100
committerRobin Appelman <icewind@owncloud.com>2015-03-26 17:07:02 +0100
commitddd6a67d2a36791e2f921596f6c34436c4d5752d (patch)
tree6a69dae39021f89c0216612423dd94b2337eb8e8 /tests
parent3ed6ed3c3674bfc60bcd2fc64edea1820f1be9d0 (diff)
downloadnextcloud-server-ddd6a67d2a36791e2f921596f6c34436c4d5752d.tar.gz
nextcloud-server-ddd6a67d2a36791e2f921596f6c34436c4d5752d.zip
Handle exceptions thrown during hooks when running unit tests
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/testcase.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/lib/testcase.php b/tests/lib/testcase.php
index f4bb8479559..d532a3b01c0 100644
--- a/tests/lib/testcase.php
+++ b/tests/lib/testcase.php
@@ -40,6 +40,14 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase {
});
}
+ protected function tearDown() {
+ $hookExceptions = \OC_Hook::$thrownExceptions;
+ \OC_Hook::$thrownExceptions = [];
+ if(!empty($hookExceptions)) {
+ throw $hookExceptions[0];
+ }
+ }
+
/**
* Returns a unique identifier as uniqid() is not reliable sometimes
*