feat: allows array formats

This commit is contained in:
Nuno Maduro
2023-06-18 01:01:29 +01:00
parent 7e815cc985
commit 355a2349af
9 changed files with 49 additions and 75 deletions

View File

@ -1,8 +1,6 @@
<?php
test('visual snapshot of help command output', function () {
$snapshot = __DIR__.'/../.snapshots/version-command.txt';
$output = function () {
$process = (new Symfony\Component\Process\Process(['php', 'bin/pest', '--version'], null, ['COLLISION_PRINTER' => 'DefaultPrinter', 'COLLISION_IGNORE_DURATION' => 'true']));
@ -11,11 +9,5 @@ test('visual snapshot of help command output', function () {
return preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $process->getOutput());
};
if (getenv('REBUILD_SNAPSHOTS')) {
file_put_contents($snapshot, $output());
$this->markTestSkipped('Snapshot rebuilt.');
}
expect($output())->toContain(file_get_contents($snapshot));
})->skipOnWindows();
expect($output())->toMatchSnapshot();
})->skipOnWindows()->skip(! getenv('REBUILD_SNAPSHOTS') && getenv('EXCLUDE'));