Skip to content

Commit d3d1774

Browse files
SanderMullerSander Muller
andauthored
Include the exit code and stderr when a bin/rector output assertion fails (#8440)
Co-authored-by: Sander Muller <sander.muller@dias.nl>
1 parent ff9a328 commit d3d1774

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎tests/Bin/RectorTest.php‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ public function testConsoleOutput(string $command, string $expectedOutput): void
3535
{
3636
$process = Process::fromShellCommandline($command);
3737
$process->run();
38-
$this->assertSame($expectedOutput, preg_replace('/ +/', ' ', $process->getOutput()));
38+
$this->assertSame($expectedOutput, preg_replace('/ +/', ' ', $process->getOutput()), sprintf(
39+
'exit code %s, stderr: %s',
40+
$process->getExitCode() ?? 'not started',
41+
$process->getErrorOutput()
42+
));
3943
}
4044
}

0 commit comments

Comments
 (0)