enable windows tests

This commit is contained in:
Fabio Ivona
2023-01-15 10:41:49 +01:00
parent 6982b02d48
commit 94cef989d3
6 changed files with 18 additions and 13 deletions

View File

@ -1,5 +1,12 @@
<?php
function normalize_windows_os_output(string $text): string
{
$text = str_replace('\r', '', $text);
return str_replace('\\', '/', $text);
}
test('visual snapshot of team city', function (string $testFile) {
$testsPath = dirname(__DIR__)."/.tests/$testFile";
@ -28,13 +35,9 @@ test('visual snapshot of team city', function (string $testFile) {
};
if (getenv('REBUILD_SNAPSHOTS')) {
$outputContent = explode("\n", $output());
file_put_contents($snapshot, implode("\n", $outputContent));
file_put_contents($snapshot, normalize_windows_os_output($output()));
} elseif (! getenv('EXCLUDE')) {
$output = explode("\n", $output());
expect(implode("\n", $output))->toEqual(file_get_contents($snapshot));
expect(normalize_windows_os_output($output()))->toEqual(file_get_contents($snapshot));
}
})->with([
'Failure.php',