From 7e649fac41d844835bc86e1131dde465366cc0df Mon Sep 17 00:00:00 2001 From: johnstevenson Date: Thu, 7 Nov 2019 09:53:22 +0000 Subject: [PATCH] Fix Windows test regression from commit 149250a Commit: 149250ab92feadd9fe045b54d6e42f33d185a595 ProcessExecutor::escape handled a false value inconsistently across platforms, returning an emtpy string on Windows, otherwise `''`. This is fixed to return `""` on Windows. The GitDownloaderTest code has been appropriately updated. --- src/Composer/Util/ProcessExecutor.php | 2 +- tests/Composer/Test/Downloader/GitDownloaderTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Util/ProcessExecutor.php b/src/Composer/Util/ProcessExecutor.php index d72a02981..00b2e7547 100644 --- a/src/Composer/Util/ProcessExecutor.php +++ b/src/Composer/Util/ProcessExecutor.php @@ -155,7 +155,7 @@ class ProcessExecutor //@see https://bugs.php.net/bug.php?id=43784 //@see https://bugs.php.net/bug.php?id=49446 if ('\\' === DIRECTORY_SEPARATOR) { - if ('' === $argument) { + if ((string) $argument === '') { return escapeshellarg($argument); } diff --git a/tests/Composer/Test/Downloader/GitDownloaderTest.php b/tests/Composer/Test/Downloader/GitDownloaderTest.php index cd3375464..9ff169925 100644 --- a/tests/Composer/Test/Downloader/GitDownloaderTest.php +++ b/tests/Composer/Test/Downloader/GitDownloaderTest.php @@ -734,7 +734,7 @@ composer https://github.com/old/url (push) $cmd = str_replace('cd ', 'cd /D ', $cmd); $cmd = str_replace('composerPath', getcwd().'/composerPath', $cmd); - return str_replace('""', '', strtr($cmd, "'", '"')); + return strtr($cmd, "'", '"'); } return $cmd;