Browse Source

Prevent HTML error pages being spewed in case of errors generated while running tests.

ADmad 12 years ago
parent
commit
ef00b9cbd8
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/Error/BaseErrorHandler.php

+ 3 - 0
src/Error/BaseErrorHandler.php

@@ -65,6 +65,9 @@ abstract class BaseErrorHandler {
 		set_error_handler([$this, 'handleError'], $level);
 		set_error_handler([$this, 'handleError'], $level);
 		set_exception_handler([$this, 'handleException']);
 		set_exception_handler([$this, 'handleException']);
 		register_shutdown_function(function () {
 		register_shutdown_function(function () {
+			if (php_sapi_name() === 'cli') {
+				return;
+			}
 			$error = error_get_last();
 			$error = error_get_last();
 			if (!is_array($error)) {
 			if (!is_array($error)) {
 				return;
 				return;