Skip to content

Commit 973c5b4

Browse files
committed
minor #1776 Fix Windows detection false-positive with "Darwin" (GromNaN)
This PR was squashed before being merged into the 1.x branch. Discussion ---------- Fix Windows detection false-positive with "Darwin" On Mac OS, `PHP_OS = 'Darwin'`, which contains `win`. This fix ensure Mac OS is not treated like Windows. Commits ------- e77f9da Fix Windows detection false-positive with "Darwin"
2 parents b5b4afa + e77f9da commit 973c5b4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Test/MakerTestEnvironment.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ final class MakerTestEnvironment
3838
private function __construct(
3939
private MakerTestDetails $testDetails,
4040
) {
41-
$this->isWindows = str_contains(strtolower(\PHP_OS), 'win');
41+
$this->isWindows = '\\' === \DIRECTORY_SEPARATOR;
4242

4343
$this->fs = new Filesystem();
4444
$this->rootPath = realpath(__DIR__.'/../../');
@@ -151,7 +151,7 @@ public function prepareDirectory(): void
151151
try {
152152
// let's do some magic here git is faster than copy
153153
MakerTestProcess::create(
154-
'\\' === \DIRECTORY_SEPARATOR ? 'git clone %FLEX_PATH% %APP_PATH%' : 'git clone "$FLEX_PATH" "$APP_PATH"',
154+
$this->isWindows ? 'git clone %FLEX_PATH% %APP_PATH%' : 'git clone "$FLEX_PATH" "$APP_PATH"',
155155
\dirname($this->flexPath),
156156
[
157157
'FLEX_PATH' => $this->flexPath,
@@ -269,7 +269,7 @@ private function buildFlexSkeleton(): void
269269
MakerTestProcess::create('composer require phpunit:1.1.* browser-kit symfony/css-selector --prefer-dist --no-progress --no-suggest', $this->flexPath)
270270
->run();
271271

272-
if ('\\' !== \DIRECTORY_SEPARATOR) {
272+
if (!$this->isWindows) {
273273
$this->fs->remove($this->flexPath.'/vendor/symfony/phpunit-bridge');
274274

275275
$this->fs->symlink($rootPath.'/vendor/symfony/phpunit-bridge', $this->flexPath.'/vendor/symfony/phpunit-bridge');

0 commit comments

Comments
 (0)