Skip to content

Commit 6ac6bc4

Browse files
staabmsebastianbergmann
authored andcommitted
Fix error_log output not displayed in failed test cases
1 parent 6f2775c commit 6ac6bc4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: src/Framework/TestCase.php

+7
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,13 @@ private function runTest(): mixed
12681268
print preg_replace('/\[.+\] /', '', $errorLogOutput);
12691269
}
12701270
} catch (Throwable $exception) {
1271+
if (!$this->expectErrorLog) {
1272+
$errorLogOutput = stream_get_contents($capture);
1273+
1274+
// strip date from logged error, see https://github.com/php/php-src/blob/c696087e323263e941774ebbf902ac249774ec9f/main/main.c#L905
1275+
print preg_replace('/\[.+\] /', '', $errorLogOutput);
1276+
}
1277+
12711278
if (!$this->shouldExceptionExpectationsBeVerified($exception)) {
12721279
throw $exception;
12731280
}

0 commit comments

Comments
 (0)