mirror of
https://github.com/pestphp/pest.git
synced 2026-07-24 02:20:03 +02:00
fix: package lock fingerprint
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
use Symfony\Component\Process\Process;
|
||||
|
||||
$run = function (string $target, $decorated = false) {
|
||||
$run = function (string $target, $decorated = false): ?string {
|
||||
$process = new Process(['php', 'bin/pest', $target, '--colors=always'], dirname(__DIR__, 2),
|
||||
['COLLISION_PRINTER' => 'DefaultPrinter', 'COLLISION_IGNORE_DURATION' => 'true'],
|
||||
['COLLISION_PRINTER' => 'DefaultPrinter', 'COLLISION_IGNORE_DURATION' => 'true', 'PAO_DISABLE' => '1'],
|
||||
);
|
||||
|
||||
$process->run();
|
||||
@@ -12,7 +12,7 @@ $run = function (string $target, $decorated = false) {
|
||||
return $decorated ? $process->getOutput() : removeAnsiEscapeSequences($process->getOutput());
|
||||
};
|
||||
|
||||
$snapshot = function ($name) {
|
||||
$snapshot = function ($name): string|false {
|
||||
$testsPath = dirname(__DIR__);
|
||||
|
||||
return file_get_contents(implode(DIRECTORY_SEPARATOR, [
|
||||
@@ -22,21 +22,21 @@ $snapshot = function ($name) {
|
||||
]));
|
||||
};
|
||||
|
||||
test('allows to run a single test', function () use ($run, $snapshot) {
|
||||
test('allows to run a single test', function () use ($run, $snapshot): void {
|
||||
expect($run('tests/Fixtures/DirectoryWithTests/ExampleTest.php'))->toContain($snapshot('allows-to-run-a-single-test'));
|
||||
})->skipOnWindows();
|
||||
|
||||
test('allows to run a directory', function () use ($run, $snapshot) {
|
||||
test('allows to run a directory', function () use ($run, $snapshot): void {
|
||||
expect($run('tests/Fixtures'))->toContain($snapshot('allows-to-run-a-directory'));
|
||||
})->skipOnWindows();
|
||||
|
||||
it('disable decorating printer when colors is set to never', function () use ($snapshot) {
|
||||
it('disable decorating printer when colors is set to never', function () use ($snapshot): void {
|
||||
$process = new Process([
|
||||
'php',
|
||||
'./bin/pest',
|
||||
'--colors=never',
|
||||
'tests/Fixtures/DirectoryWithTests/ExampleTest.php',
|
||||
], dirname(__DIR__, 2), ['COLLISION_PRINTER' => 'DefaultPrinter', 'COLLISION_IGNORE_DURATION' => 'true']);
|
||||
], dirname(__DIR__, 2), ['COLLISION_PRINTER' => 'DefaultPrinter', 'COLLISION_IGNORE_DURATION' => 'true', 'PAO_DISABLE' => '1']);
|
||||
$process->run();
|
||||
$output = $process->getOutput();
|
||||
expect($output)->toContain($snapshot('disable-decorating-printer'));
|
||||
|
||||
Reference in New Issue
Block a user