Skip to content

Commit

Permalink
Merge pull request #140 from PHPCSStandards/feature/iotestcase-perfor…
Browse files Browse the repository at this point in the history
…mance-tweak

Tests: performance improvement
  • Loading branch information
jrfnl authored Mar 4, 2024
2 parents e460a85 + 57b32ef commit 9dba7c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Tests/IOTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace PHPCSDevTools\Tests;

use RuntimeException;
use Yoast\PHPUnitPolyfills\TestCases\XTestCase;

/**
Expand Down Expand Up @@ -51,8 +52,12 @@ protected function executeCliCommand($command, $workingDir = null)
2 => ['pipe', 'w'], // stderr
];

$process = \proc_open($command, $descriptorspec, $pipes, $workingDir);
$options = null;
if (stripos(PHP_OS, 'WIN') === 0) {
$options = ['bypass_shell' => true];
}

$process = \proc_open($command, $descriptorspec, $pipes, $workingDir, null, $options);
if (\is_resource($process) === false) {
throw new RuntimeException('Could not obtain a resource with proc_open() to execute the command.');
}
Expand Down

0 comments on commit 9dba7c9

Please sign in to comment.