summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/base.php8
-rw-r--r--tests/bootstrap.php3
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/base.php b/lib/base.php
index 90e64f13af6..b432f282aaf 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -402,9 +402,11 @@ class OC {
self::initPaths();
- register_shutdown_function(array('OC_Log', 'onShutdown'));
- set_error_handler(array('OC_Log', 'onError'));
- set_exception_handler(array('OC_Log', 'onException'));
+ if (!defined('PHPUNIT_RUN')) {
+ register_shutdown_function(array('OC_Log', 'onShutdown'));
+ set_error_handler(array('OC_Log', 'onError'));
+ set_exception_handler(array('OC_Log', 'onException'));
+ }
// set debug mode if an xdebug session is active
if (!defined('DEBUG') || !DEBUG) {
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index b97161ee6e4..fb667263e45 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -2,6 +2,9 @@
global $RUNTIME_NOAPPS;
$RUNTIME_NOAPPS = true;
+
+define('PHPUNIT_RUN', 1);
+
require_once __DIR__.'/../lib/base.php';
if(!class_exists('PHPUnit_Framework_TestCase')) {