]> source.dussan.org Git - nextcloud-server.git/commitdiff
disable error handler while running phpunit
authorThomas Mueller <thomas.mueller@tmit.eu>
Thu, 31 Jan 2013 21:05:06 +0000 (22:05 +0100)
committerThomas Mueller <thomas.mueller@tmit.eu>
Tue, 5 Feb 2013 15:44:02 +0000 (16:44 +0100)
lib/base.php
tests/bootstrap.php

index 90e64f13af616dbc22221d445333cb74d4304dad..b432f282aafd0ae819dde64782965c81209433b8 100644 (file)
@@ -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) {
index b97161ee6e4263ff3561ee9a64d9d1896b2407dd..fb667263e45474a3dab4b0c2f26eaa4eee36f071 100644 (file)
@@ -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')) {