Skip to content

Commit 9dba7c9

Browse files
authored
Merge pull request #140 from PHPCSStandards/feature/iotestcase-performance-tweak
Tests: performance improvement
2 parents e460a85 + 57b32ef commit 9dba7c9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Tests/IOTestCase.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
namespace PHPCSDevTools\Tests;
1212

13+
use RuntimeException;
1314
use Yoast\PHPUnitPolyfills\TestCases\XTestCase;
1415

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

54-
$process = \proc_open($command, $descriptorspec, $pipes, $workingDir);
55+
$options = null;
56+
if (stripos(PHP_OS, 'WIN') === 0) {
57+
$options = ['bypass_shell' => true];
58+
}
5559

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

0 commit comments

Comments
 (0)