tests: fixes visual testing on windows

This commit is contained in:
Nuno Maduro
2020-06-10 21:32:54 +02:00
parent bd48232c61
commit 4254d71039

View File

@ -7,7 +7,11 @@ $run = function (string $target, $decorated = false) {
$process->run();
return $decorated ? $process->getOutput() : preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $process->getOutput());
$output = $decorated ? $process->getOutput() : preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $process->getOutput());
$output = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? str_replace("\n", "\r\n", $output) : $output;
return $output;
};
$snapshot = function ($name) {