diff --git a/src/Runner/CliTester.php b/src/Runner/CliTester.php
index 9ea54bbd..24bfa4e2 100644
--- a/src/Runner/CliTester.php
+++ b/src/Runner/CliTester.php
@@ -57,6 +57,7 @@ public function run(): ?int
if ($this->options['--info']) {
$job = new Job(new Test(__DIR__ . '/info.php'), $this->interpreter);
+ $job->setTempDirectory($this->options['--temp']);
$job->run();
echo $job->getTest()->stdout;
return null;
diff --git a/src/Runner/Job.php b/src/Runner/Job.php
index 9384633f..2af46022 100644
--- a/src/Runner/Job.php
+++ b/src/Runner/Job.php
@@ -27,9 +27,7 @@ class Job
/** waiting time between process activity check in microseconds */
public const RUN_USLEEP = 10000;
- public const
- RUN_ASYNC = 1,
- RUN_COLLECT_ERRORS = 2;
+ public const RUN_ASYNC = 1;
/** @var Test */
private $test;
@@ -46,8 +44,8 @@ class Job
/** @var resource|null */
private $stdout;
- /** @var resource|null */
- private $stderr;
+ /** @var string|null */
+ private $stderrFile;
/** @var int */
private $exitCode = self::CODE_NONE;
@@ -74,6 +72,14 @@ public function __construct(Test $test, PhpInterpreter $interpreter, ?array $env
}
+ public function setTempDirectory(?string $path): void
+ {
+ $this->stderrFile = $path === null
+ ? null
+ : $path . DIRECTORY_SEPARATOR . 'Job.pid-' . getmypid() . '.' . uniqid() . '.stderr';
+ }
+
+
public function setEnvironmentVariable(string $name, string $value): void
{
$this->envVars[$name] = $value;
@@ -88,7 +94,7 @@ public function getEnvironmentVariable(string $name): string
/**
* Runs single test.
- * @param int $flags self::RUN_ASYNC | self::RUN_COLLECT_ERRORS
+ * @param int $flags self::RUN_ASYNC
*/
public function run(int $flags = 0): void
{
@@ -110,7 +116,7 @@ public function run(int $flags = 0): void
[
['pipe', 'r'],
['pipe', 'w'],
- ['pipe', 'w'],
+ $this->stderrFile ? ['file', $this->stderrFile, 'w'] : ['pipe', 'w'],
],
$pipes,
dirname($this->test->getFile()),
@@ -122,19 +128,15 @@ public function run(int $flags = 0): void
putenv($name);
}
- [$stdin, $this->stdout, $stderr] = $pipes;
+ [$stdin, $this->stdout] = $pipes;
fclose($stdin);
- if ($flags & self::RUN_COLLECT_ERRORS) {
- $this->stderr = $stderr;
- } else {
- fclose($stderr);
+
+ if (isset($pipes[2])) {
+ fclose($pipes[2]);
}
if ($flags & self::RUN_ASYNC) {
stream_set_blocking($this->stdout, false); // on Windows does not work with proc_open()
- if ($this->stderr) {
- stream_set_blocking($this->stderr, false);
- }
} else {
while ($this->isRunning()) {
usleep(self::RUN_USLEEP); // stream_select() doesn't work with proc_open()
@@ -153,9 +155,6 @@ public function isRunning(): bool
}
$this->test->stdout .= stream_get_contents($this->stdout);
- if ($this->stderr) {
- $this->test->stderr .= stream_get_contents($this->stderr);
- }
$status = proc_get_status($this->proc);
if ($status['running']) {
@@ -165,8 +164,9 @@ public function isRunning(): bool
$this->duration += microtime(true);
fclose($this->stdout);
- if ($this->stderr) {
- fclose($this->stderr);
+ if ($this->stderrFile) {
+ $this->test->stderr .= file_get_contents($this->stderrFile);
+ unlink($this->stderrFile);
}
$code = proc_close($this->proc);
diff --git a/src/Runner/Output/ConsolePrinter.php b/src/Runner/Output/ConsolePrinter.php
index bb3d9ffa..d190deff 100644
--- a/src/Runner/Output/ConsolePrinter.php
+++ b/src/Runner/Output/ConsolePrinter.php
@@ -112,6 +112,7 @@ public function finish(Test $test): void
$title = ($test->title ? "$test->title | " : '') . substr($test->getSignature(), strlen($this->baseDir));
$message = ' ' . str_replace("\n", "\n ", trim((string) $test->message)) . "\n\n";
+ $message = preg_replace('/^ $/m', '', $message);
if ($test->getResult() === Test::FAILED) {
$this->buffer .= Dumper::color('red', "-- FAILED: $title") . "\n$message";
} elseif ($test->getResult() === Test::SKIPPED && $this->displaySkipped) {
diff --git a/src/Runner/Test.php b/src/Runner/Test.php
index c118c619..132eac0f 100644
--- a/src/Runner/Test.php
+++ b/src/Runner/Test.php
@@ -97,6 +97,15 @@ public function getDuration(): ?float
}
+ /**
+ * Full output (stdout + stderr)
+ */
+ public function getOutput(): string
+ {
+ return $this->stdout . ($this->stderr ? "\nSTDERR:\n" . $this->stderr : '');
+ }
+
+
/**
* @return static
*/
diff --git a/src/Runner/TestHandler.php b/src/Runner/TestHandler.php
index 5a8fa0da..6a795186 100644
--- a/src/Runner/TestHandler.php
+++ b/src/Runner/TestHandler.php
@@ -78,7 +78,9 @@ public function initiate(string $file): void
foreach ($tests as $test) {
$this->runner->prepareTest($test);
- $this->runner->addJob(new Job($test, $php, $this->runner->getEnvironmentVariables()));
+ $job = new Job($test, $php, $this->runner->getEnvironmentVariables());
+ $job->setTempDirectory($this->tempDir);
+ $this->runner->addJob($job);
}
}
@@ -198,10 +200,11 @@ private function initiateTestCase(Test $test, $foo, PhpInterpreter $interpreter)
if ($methods === null) {
$job = new Job($test->withArguments(['method' => TestCase::ListMethods]), $interpreter, $this->runner->getEnvironmentVariables());
+ $job->setTempDirectory($this->tempDir);
$job->run();
if (in_array($job->getExitCode(), [Job::CODE_ERROR, Job::CODE_FAIL, Job::CODE_SKIP], true)) {
- return $test->withResult($job->getExitCode() === Job::CODE_SKIP ? Test::SKIPPED : Test::FAILED, $job->getTest()->stdout);
+ return $test->withResult($job->getExitCode() === Job::CODE_SKIP ? Test::SKIPPED : Test::FAILED, $job->getTest()->getOutput());
}
$stdout = $job->getTest()->stdout;
@@ -248,7 +251,7 @@ private function assessExitCode(Job $job, $code): ?Test
$message = $job->getExitCode() !== Job::CODE_FAIL
? "Exited with error code {$job->getExitCode()} (expected $code)"
: '';
- return $job->getTest()->withResult(Test::FAILED, trim($message . "\n" . $job->getTest()->stdout));
+ return $job->getTest()->withResult(Test::FAILED, trim($message . "\n" . $job->getTest()->getOutput()));
}
return null;
diff --git a/tests/Runner/Job.phpt b/tests/Runner/Job.phpt
index 2e5ffe22..c0099903 100644
--- a/tests/Runner/Job.phpt
+++ b/tests/Runner/Job.phpt
@@ -13,7 +13,8 @@ require __DIR__ . '/../bootstrap.php';
test(function () {
$test = (new Test('Job.test.phptx'))->withArguments(['one', 'two' => 1])->withArguments(['three', 'two' => 2]);
$job = new Job($test, createInterpreter());
- $job->run($job::RUN_COLLECT_ERRORS);
+ $job->setTempDirectory(Tester\Helpers::prepareTempDir(sys_get_temp_dir()));
+ $job->run();
Assert::false($job->isRunning());
Assert::same($test, $job->getTest());
diff --git a/tests/Runner/Runner.multiple-fails.phpt b/tests/Runner/Runner.multiple-fails.phpt
index 0ccde458..c3cd7c2a 100644
--- a/tests/Runner/Runner.multiple-fails.phpt
+++ b/tests/Runner/Runner.multiple-fails.phpt
@@ -47,6 +47,7 @@ $interpreter = createInterpreter()
$runner = new Runner($interpreter);
$runner->paths[] = __DIR__ . '/multiple-fails/*.phptx';
$runner->outputHandlers[] = $logger = new Logger;
+$runner->setTempDirectory(Tester\Helpers::prepareTempDir(sys_get_temp_dir()));
$runner->run();
Assert::match(
@@ -86,8 +87,8 @@ Assert::same(Test::FAILED, $logger->results['testcase-pre-fail.phptx'][0]);
Assert::match(
defined('PHPDBG_VERSION')
- ? '%A%Parse error: %a% in %a%testcase-syntax-error.phptx on line %d%'
- : 'Parse error: %a% in %a%testcase-syntax-error.phptx on line %d%',
+ ? '%A%Parse error: %a% in %a%testcase-syntax-error.phptx on line %d%%A?%'
+ : 'Parse error: %a% in %a%testcase-syntax-error.phptx on line %d%%A?%',
trim($logger->results['testcase-syntax-error.phptx'][1])
);
Assert::same(Test::FAILED, $logger->results['testcase-syntax-error.phptx'][0]);
diff --git a/tests/Runner/Test.phpt b/tests/Runner/Test.phpt
index 52ab34f8..41fb4a55 100644
--- a/tests/Runner/Test.phpt
+++ b/tests/Runner/Test.phpt
@@ -20,6 +20,7 @@ test(function () {
Assert::null($test->message);
Assert::same('', $test->stdout);
Assert::same('', $test->stderr);
+ Assert::same('', $test->getOutput());
Assert::same('some/Test.phpt', $test->getFile());
Assert::same([], $test->getArguments());
Assert::same('some/Test.phpt', $test->getSignature());
diff --git a/tests/RunnerOutput/OutputHandlers.expect.console.txt b/tests/RunnerOutput/OutputHandlers.expect.console.txt
index 2c510909..ddc4a9c2 100644
--- a/tests/RunnerOutput/OutputHandlers.expect.console.txt
+++ b/tests/RunnerOutput/OutputHandlers.expect.console.txt
@@ -7,14 +7,24 @@ F.sF.sFsF.s
line
stdout.Failed:
- in %a%01-basic.fail.phptx(7) Tester\Assert::fail('');
+ in %a%01-basic.fail.phptx(%d%) Tester\Assert::fail('');
+
+ STDERR:
+ Multi
+ line
+ stderr.
-- FAILED: Title for output handlers | 02-title.fail.phptx
Multi
line
stdout.Failed:
- in %a%02-title.fail.phptx(11) Tester\Assert::fail('');
+ in %a%02-title.fail.phptx(%d%) Tester\Assert::fail('');
+
+ STDERR:
+ Multi
+ line
+ stderr.
-- FAILED: 03-message.fail.phptx
Multi
@@ -23,14 +33,24 @@ F.sF.sFsF.s
line
message.
- in %a%03-message.fail.phptx(7) Tester\Assert::fail("Multi\nline\nmessage.");
+ in %a%03-message.fail.phptx(%d%) Tester\Assert::fail("Multi\nline\nmessage.");
+
+ STDERR:
+ Multi
+ line
+ stderr.
-- FAILED: 04-args.fail.phptx dataprovider=thisIsAVeryVeryVeryLongArgumentNameToTestHowOutputHandlersDealWithItsLengthInTheirOutputFormatting|%a%provider.ini
Multi
line
stdout.Failed:
- in %a%04-args.fail.phptx(11) Tester\Assert::fail('');
+ in %a%04-args.fail.phptx(%d%) Tester\Assert::fail('');
+
+ STDERR:
+ Multi
+ line
+ stderr.
FAILURES! (11 tests, 4 failures, 4 skipped, %a% seconds)
diff --git a/tests/RunnerOutput/OutputHandlers.expect.consoleWithSkip.txt b/tests/RunnerOutput/OutputHandlers.expect.consoleWithSkip.txt
index f1b69a4c..b88ad012 100644
--- a/tests/RunnerOutput/OutputHandlers.expect.consoleWithSkip.txt
+++ b/tests/RunnerOutput/OutputHandlers.expect.consoleWithSkip.txt
@@ -7,43 +7,63 @@ F.sF.sFsF.s
line
stdout.Failed:
- in %a%01-basic.fail.phptx(7) Tester\Assert::fail('');
+ in %a%01-basic.fail.phptx(%d%) Tester\Assert::fail('');
--- Skipped: %a?%01-basic.skip.phptx
+ STDERR:
+ Multi
+ line
+ stderr.
+
+-- Skipped: 01-basic.skip.phptx
--- FAILED: Title for output handlers | 02-title.fail.phptx
+-- FAILED: Title for output handlers | %a?%02-title.fail.phptx
Multi
line
stdout.Failed:
- in %a%02-title.fail.phptx(11) Tester\Assert::fail('');
+ in %a%02-title.fail.phptx(%d%) Tester\Assert::fail('');
+
+ STDERR:
+ Multi
+ line
+ stderr.
--- Skipped: Title for output handlers | 02-title.skip.phptx
+-- Skipped: Title for output handlers | %a?%02-title.skip.phptx
--- FAILED: 03-message.fail.phptx
+-- FAILED: %a?%03-message.fail.phptx
Multi
line
stdout.Failed: Multi
line
message.
- in %a%03-message.fail.phptx(7) Tester\Assert::fail("Multi\nline\nmessage.");
+ in %a%03-message.fail.phptx(%d%) Tester\Assert::fail("Multi\nline\nmessage.");
--- Skipped: 03-message.skip.phptx
+ STDERR:
+ Multi
+ line
+ stderr.
+
+-- Skipped: %a?%03-message.skip.phptx
Multi
line
message.
--- FAILED: 04-args.fail.phptx dataprovider=thisIsAVeryVeryVeryLongArgumentNameToTestHowOutputHandlersDealWithItsLengthInTheirOutputFormatting|%a%provider.ini
+-- FAILED: %a?%04-args.fail.phptx dataprovider=thisIsAVeryVeryVeryLongArgumentNameToTestHowOutputHandlersDealWithItsLengthInTheirOutputFormatting|%a%provider.ini
Multi
line
stdout.Failed:
- in %a%04-args.fail.phptx(11) Tester\Assert::fail('');
+ in %a%04-args.fail.phptx(%d%) Tester\Assert::fail('');
+
+ STDERR:
+ Multi
+ line
+ stderr.
--- Skipped: 04-args.skip.phptx dataprovider=thisIsAVeryVeryVeryLongArgumentNameToTestHowOutputHandlersDealWithItsLengthInTheirOutputFormatting|%a%provider.ini
+-- Skipped: %a?%04-args.skip.phptx dataprovider=thisIsAVeryVeryVeryLongArgumentNameToTestHowOutputHandlersDealWithItsLengthInTheirOutputFormatting|%a%provider.ini
Multi
line
message.
diff --git a/tests/RunnerOutput/OutputHandlers.expect.jUnit.xml b/tests/RunnerOutput/OutputHandlers.expect.jUnit.xml
index 6e95109e..1337f8b8 100644
--- a/tests/RunnerOutput/OutputHandlers.expect.jUnit.xml
+++ b/tests/RunnerOutput/OutputHandlers.expect.jUnit.xml
@@ -6,7 +6,12 @@
line
stdout.Failed:
-in %a%01-basic.fail.phptx(7) Tester\Assert::fail('');"/>
+in %a%01-basic.fail.phptx(%d%) Tester\Assert::fail('');
+
+STDERR:
+Multi
+line
+stderr."/>
@@ -17,7 +22,12 @@ in %a%01-basic.fail.phptx(7) Tester\Assert::fail('');"/>
line
stdout.Failed:
-in %a%02-title.fail.phptx(11) Tester\Assert::fail('');"/>
+in %a%02-title.fail.phptx(%d%) Tester\Assert::fail('');
+
+STDERR:
+Multi
+line
+stderr."/>
@@ -30,7 +40,12 @@ stdout.Failed: Multi
line
message.
-in %a%03-message.fail.phptx(7) Tester\Assert::fail("Multi\nline\nmessage.");"/>
+in %a%03-message.fail.phptx(%d%) Tester\Assert::fail("Multi\nline\nmessage.");
+
+STDERR:
+Multi
+line
+stderr."/>
@@ -40,7 +55,12 @@ in %a%03-message.fail.phptx(7) Tester\Assert::fail("Multi\nline\nmessage.&q
line
stdout.Failed:
-in %a%04-args.fail.phptx(11) Tester\Assert::fail('');"/>
+in %a%04-args.fail.phptx(%d%) Tester\Assert::fail('');
+
+STDERR:
+Multi
+line
+stderr."/>
diff --git a/tests/RunnerOutput/OutputHandlers.expect.logger.txt b/tests/RunnerOutput/OutputHandlers.expect.logger.txt
index f841cdc0..9c759cc3 100644
--- a/tests/RunnerOutput/OutputHandlers.expect.logger.txt
+++ b/tests/RunnerOutput/OutputHandlers.expect.logger.txt
@@ -5,7 +5,12 @@
line
stdout.Failed:
- in %a%01-basic.fail.phptx(7) Tester\Assert::fail('');
+ in %a%01-basic.fail.phptx(%d%) Tester\Assert::fail('');
+
+ STDERR:
+ Multi
+ line
+ stderr.
-- OK: %a%01-basic.pass.phptx
@@ -17,7 +22,12 @@
line
stdout.Failed:
- in %a%02-title.fail.phptx(11) Tester\Assert::fail('');
+ in %a%02-title.fail.phptx(%d%) Tester\Assert::fail('');
+
+ STDERR:
+ Multi
+ line
+ stderr.
-- OK: %a%02-title.pass.phptx
@@ -31,7 +41,12 @@
line
message.
- in %a%03-message.fail.phptx(7) Tester\Assert::fail("Multi\nline\nmessage.");
+ in %a%03-message.fail.phptx(%d%) Tester\Assert::fail("Multi\nline\nmessage.");
+
+ STDERR:
+ Multi
+ line
+ stderr.
-- Skipped: %a%03-message.skip.phptx
Multi
@@ -43,7 +58,12 @@
line
stdout.Failed:
- in %a%04-args.fail.phptx(11) Tester\Assert::fail('');
+ in %a%04-args.fail.phptx(%d%) Tester\Assert::fail('');
+
+ STDERR:
+ Multi
+ line
+ stderr.
-- OK: %a%04-args.pass.phptx dataprovider=thisIsAVeryVeryVeryLongArgumentNameToTestHowOutputHandlersDealWithItsLengthInTheirOutputFormatting|%a%provider.ini
diff --git a/tests/RunnerOutput/OutputHandlers.expect.tap.txt b/tests/RunnerOutput/OutputHandlers.expect.tap.txt
index 9d69565c..15d4e87f 100644
--- a/tests/RunnerOutput/OutputHandlers.expect.tap.txt
+++ b/tests/RunnerOutput/OutputHandlers.expect.tap.txt
@@ -4,7 +4,12 @@ not ok %a%01-basic.fail.phptx
# line
# stdout.Failed:
#
-# in %a%01-basic.fail.phptx(7) Tester\Assert::fail('');
+# in %a%01-basic.fail.phptx(%d%) Tester\Assert::fail('');
+#
+# STDERR:
+# Multi
+# line
+# stderr.
ok %a%01-basic.pass.phptx
ok %a%01-basic.skip.phptx #skip
not ok %a%02-title.fail.phptx
@@ -12,7 +17,12 @@ not ok %a%02-title.fail.phptx
# line
# stdout.Failed:
#
-# in %a%02-title.fail.phptx(11) Tester\Assert::fail('');
+# in %a%02-title.fail.phptx(%d%) Tester\Assert::fail('');
+#
+# STDERR:
+# Multi
+# line
+# stderr.
ok %a%02-title.pass.phptx
ok %a%02-title.skip.phptx #skip
not ok %a%03-message.fail.phptx
@@ -22,7 +32,12 @@ not ok %a%03-message.fail.phptx
# line
# message.
#
-# in %a%03-message.fail.phptx(7) Tester\Assert::fail("Multi\nline\nmessage.");
+# in %a%03-message.fail.phptx(%d%) Tester\Assert::fail("Multi\nline\nmessage.");
+#
+# STDERR:
+# Multi
+# line
+# stderr.
ok %a%03-message.skip.phptx #skip Multi
# line
# message.
@@ -31,7 +46,12 @@ not ok %a%04-args.fail.phptx dataprovider=thisIsAVeryVeryVeryLongArgumentNameToT
# line
# stdout.Failed:
#
-# in %a%04-args.fail.phptx(11) Tester\Assert::fail('');
+# in %a%04-args.fail.phptx(%d%) Tester\Assert::fail('');
+#
+# STDERR:
+# Multi
+# line
+# stderr.
ok %a%04-args.pass.phptx dataprovider=thisIsAVeryVeryVeryLongArgumentNameToTestHowOutputHandlersDealWithItsLengthInTheirOutputFormatting|%a%provider.ini
ok %a%04-args.skip.phptx dataprovider=thisIsAVeryVeryVeryLongArgumentNameToTestHowOutputHandlersDealWithItsLengthInTheirOutputFormatting|%a%provider.ini #skip Multi
# line
diff --git a/tests/RunnerOutput/OutputHandlers.phpt b/tests/RunnerOutput/OutputHandlers.phpt
index 2be5090b..2c00797c 100644
--- a/tests/RunnerOutput/OutputHandlers.phpt
+++ b/tests/RunnerOutput/OutputHandlers.phpt
@@ -22,8 +22,11 @@ require __DIR__ . '/../../src/Runner/Output/JUnitPrinter.php';
require __DIR__ . '/../../src/Runner/Output/Logger.php';
require __DIR__ . '/../../src/Runner/Output/TapPrinter.php';
+$tempDir = Tester\Helpers::prepareTempDir(sys_get_temp_dir()) . '/oh-test';
+Tester\Helpers::purge($tempDir);
$runner = new Runner(createInterpreter());
+$runner->setTempDirectory($tempDir);
$runner->setEnvironmentVariable(Tester\Environment::RUNNER, '1');
$runner->setEnvironmentVariable(Tester\Environment::COLORS, '0');
$runner->paths[] = __DIR__ . '/cases/*.phptx';
diff --git a/tests/RunnerOutput/cases/01-basic.fail.phptx b/tests/RunnerOutput/cases/01-basic.fail.phptx
index 75b2f393..a9fa776a 100644
--- a/tests/RunnerOutput/cases/01-basic.fail.phptx
+++ b/tests/RunnerOutput/cases/01-basic.fail.phptx
@@ -4,4 +4,6 @@ require __DIR__ . '/../../bootstrap.php';
echo "Multi\nline\nstdout.";
+file_put_contents('php://stderr', "Multi\nline\nstderr.");
+
Tester\Assert::fail('');
diff --git a/tests/RunnerOutput/cases/01-basic.pass.phptx b/tests/RunnerOutput/cases/01-basic.pass.phptx
index eb2d2605..af3fce43 100644
--- a/tests/RunnerOutput/cases/01-basic.pass.phptx
+++ b/tests/RunnerOutput/cases/01-basic.pass.phptx
@@ -4,3 +4,5 @@ require __DIR__ . '/../../bootstrap.php';
Tester\Environment::$checkAssertions = false;
echo "Multi\nline\nstdout.";
+
+file_put_contents('php://stderr', "Multi\nline\nstderr.");
diff --git a/tests/RunnerOutput/cases/01-basic.skip.phptx b/tests/RunnerOutput/cases/01-basic.skip.phptx
index a0f7247a..b01b7f8d 100644
--- a/tests/RunnerOutput/cases/01-basic.skip.phptx
+++ b/tests/RunnerOutput/cases/01-basic.skip.phptx
@@ -4,4 +4,6 @@ require __DIR__ . '/../../bootstrap.php';
echo "Multi\nline\nstdout.";
+file_put_contents('php://stderr', "Multi\nline\nstderr.");
+
Tester\Environment::skip();
diff --git a/tests/RunnerOutput/cases/02-title.fail.phptx b/tests/RunnerOutput/cases/02-title.fail.phptx
index ea1aa26a..bfedf573 100644
--- a/tests/RunnerOutput/cases/02-title.fail.phptx
+++ b/tests/RunnerOutput/cases/02-title.fail.phptx
@@ -8,4 +8,6 @@ require __DIR__ . '/../../bootstrap.php';
echo "Multi\nline\nstdout.";
+file_put_contents('php://stderr', "Multi\nline\nstderr.");
+
Tester\Assert::fail('');
diff --git a/tests/RunnerOutput/cases/02-title.pass.phptx b/tests/RunnerOutput/cases/02-title.pass.phptx
index c9356ff2..6e3014b6 100644
--- a/tests/RunnerOutput/cases/02-title.pass.phptx
+++ b/tests/RunnerOutput/cases/02-title.pass.phptx
@@ -8,3 +8,5 @@ require __DIR__ . '/../../bootstrap.php';
Tester\Environment::$checkAssertions = false;
echo "Multi\nline\nstdout.";
+
+file_put_contents('php://stderr', "Multi\nline\nstderr.");
diff --git a/tests/RunnerOutput/cases/02-title.skip.phptx b/tests/RunnerOutput/cases/02-title.skip.phptx
index 6f0ba2c9..ee5a4b6c 100644
--- a/tests/RunnerOutput/cases/02-title.skip.phptx
+++ b/tests/RunnerOutput/cases/02-title.skip.phptx
@@ -8,4 +8,6 @@ require __DIR__ . '/../../bootstrap.php';
echo "Multi\nline\nstdout.";
+file_put_contents('php://stderr', "Multi\nline\nstderr.");
+
Tester\Environment::skip();
diff --git a/tests/RunnerOutput/cases/03-message.fail.phptx b/tests/RunnerOutput/cases/03-message.fail.phptx
index 74a820f2..48462822 100644
--- a/tests/RunnerOutput/cases/03-message.fail.phptx
+++ b/tests/RunnerOutput/cases/03-message.fail.phptx
@@ -4,4 +4,6 @@ require __DIR__ . '/../../bootstrap.php';
echo "Multi\nline\nstdout.";
+file_put_contents('php://stderr', "Multi\nline\nstderr.");
+
Tester\Assert::fail("Multi\nline\nmessage.");
diff --git a/tests/RunnerOutput/cases/03-message.skip.phptx b/tests/RunnerOutput/cases/03-message.skip.phptx
index 633377c1..4cad6ea8 100644
--- a/tests/RunnerOutput/cases/03-message.skip.phptx
+++ b/tests/RunnerOutput/cases/03-message.skip.phptx
@@ -4,4 +4,6 @@ require __DIR__ . '/../../bootstrap.php';
echo "Multi\nline\nstdout.";
+file_put_contents('php://stderr', "Multi\nline\nstderr.");
+
Tester\Environment::skip("Multi\nline\nmessage.");
diff --git a/tests/RunnerOutput/cases/04-args.fail.phptx b/tests/RunnerOutput/cases/04-args.fail.phptx
index d102b30d..c3fd7a60 100644
--- a/tests/RunnerOutput/cases/04-args.fail.phptx
+++ b/tests/RunnerOutput/cases/04-args.fail.phptx
@@ -8,4 +8,6 @@ require __DIR__ . '/../../bootstrap.php';
echo "Multi\nline\nstdout.";
+file_put_contents('php://stderr', "Multi\nline\nstderr.");
+
Tester\Assert::fail('');
diff --git a/tests/RunnerOutput/cases/04-args.pass.phptx b/tests/RunnerOutput/cases/04-args.pass.phptx
index fd259396..720faa06 100644
--- a/tests/RunnerOutput/cases/04-args.pass.phptx
+++ b/tests/RunnerOutput/cases/04-args.pass.phptx
@@ -8,3 +8,5 @@ require __DIR__ . '/../../bootstrap.php';
Tester\Environment::$checkAssertions = false;
echo "Multi\nline\nstdout.";
+
+file_put_contents('php://stderr', "Multi\nline\nstderr.");
diff --git a/tests/RunnerOutput/cases/04-args.skip.phptx b/tests/RunnerOutput/cases/04-args.skip.phptx
index a431fb8b..4ef1d606 100644
--- a/tests/RunnerOutput/cases/04-args.skip.phptx
+++ b/tests/RunnerOutput/cases/04-args.skip.phptx
@@ -8,4 +8,6 @@ require __DIR__ . '/../../bootstrap.php';
echo "Multi\nline\nstdout.";
+file_put_contents('php://stderr', "Multi\nline\nstderr.");
+
Tester\Environment::skip("Multi\nline\nmessage.");