Skip to content

Commit bbe714f

Browse files
committed
simple error log during unit tests
1 parent 34b2135 commit bbe714f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

resources/lib/UnitySite.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ private static function headerResponseCode(int $code, string $reason)
3939

4040
public static function errorLog(string $title, string $message)
4141
{
42+
if (@$GLOBALS["PHPUNIT_SIMPLE_ERROR_LOG_PLEASE"] == true) {
43+
error_log("$title: $message");
44+
return;
45+
}
4246
error_log(
4347
"$title: " . json_encode(
4448
[

test/phpunit-bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
require_once __DIR__ . "/../resources/lib/exceptions/SSOException.php";
2323

2424
$GLOBALS["PHPUNIT_NO_DIE_PLEASE"] = true;
25+
$GLOBALS["PHPUNIT_SIMPLE_ERROR_LOG_PLEASE"] = true;
2526

2627
global $HTTP_HEADER_TEST_INPUTS;
2728
$HTTP_HEADER_TEST_INPUTS = [

0 commit comments

Comments
 (0)