ソースを参照

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

ADmad 12 年 前
コミット
ef00b9cbd8
1 ファイル変更3 行追加0 行削除
  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_exception_handler([$this, 'handleException']);
 		register_shutdown_function(function () {
+			if (php_sapi_name() === 'cli') {
+				return;
+			}
 			$error = error_get_last();
 			if (!is_array($error)) {
 				return;