From 49abae0100e8f07035583a406ac2a68d8b6cfbfe Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 07:37:40 +0200 Subject: [PATCH 01/18] Add appveyor config file --- .appveyor.yml | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 000000000..084c7db8f --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,51 @@ +build: false +platform: + - x64 +clone_folder: c:\projects\box +version: '{build}.{branch}' + +environment: + matrix: + - dependencies: lowest + php_ver_target: 7.1 + - dependencies: current + php_ver_target: 7.2 + - dependencies: highest + php_ver_target: 7.3 + +cache: + - '%LOCALAPPDATA%\Composer\files' + - composer.phar + - C:\ProgramData\chocolatey\bin -> .appveyor.yml + - C:\ProgramData\chocolatey\lib -> .appveyor.yml + - c:\tools\php -> .appveyor.yml + +init: + - SET PATH=C:\Program Files\OpenSSL;c:\tools\php\%php_ver_target%;%PATH% + - SET COMPOSER_NO_INTERACTION=1 + - SET ANSICON=121x90 (121x90) + - REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f + +install: + - IF NOT EXIST c:\php mkdir c:\php + - IF NOT EXIST c:\php\%php_ver_target% mkdir c:\php\%php_ver_target% + - ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php\%php_ver_target%""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','') + - cd c:\tools\php\%php_ver_target% + - copy php.ini-production php.ini /Y + - echo date.timezone="UTC" >> php.ini + - echo extension_dir=ext >> php.ini + - echo extension=php_openssl.dll >> php.ini + - echo extension=php_mbstring.dll >> php.ini + - echo extension=php_fileinfo.dll >> php.ini + - cd c:\projects\box + - echo @php %%~dp0composer.phar %%* > composer.bat + - IF NOT EXIST composer.phar (appveyor-retry appveyor DownloadFile https://github.com/composer/composer/releases/download/1.7.1/composer.phar) + - php composer.phar self-update + - IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev) + - IF %dependencies%==lowest appveyor-retry composer update --prefer-lowest --no-progress --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==current appveyor-retry composer update --no-progress --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==highest appveyor-retry composer update --no-progress -n --ansi --no-suggest --prefer-dist -n + +test_script: + - cd c:\projects\box + - php bin/phpunit From 3fb5c5ce86c5f048c5b21d29c47642a99a9c7347 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 07:40:39 +0200 Subject: [PATCH 02/18] Remove composer.bat file and use composer.phar directly --- .appveyor.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 084c7db8f..751db6f75 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -38,13 +38,12 @@ install: - echo extension=php_mbstring.dll >> php.ini - echo extension=php_fileinfo.dll >> php.ini - cd c:\projects\box - - echo @php %%~dp0composer.phar %%* > composer.bat - IF NOT EXIST composer.phar (appveyor-retry appveyor DownloadFile https://github.com/composer/composer/releases/download/1.7.1/composer.phar) - php composer.phar self-update - IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev) - - IF %dependencies%==lowest appveyor-retry composer update --prefer-lowest --no-progress --ansi --no-suggest --prefer-dist -n - - IF %dependencies%==current appveyor-retry composer update --no-progress --ansi --no-suggest --prefer-dist -n - - IF %dependencies%==highest appveyor-retry composer update --no-progress -n --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==lowest appveyor-retry php composer.phar update --prefer-lowest --no-progress --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==current appveyor-retry php composer.phar update --no-progress --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==highest appveyor-retry php composer.phar update --no-progress -n --ansi --no-suggest --prefer-dist -n test_script: - cd c:\projects\box From 8ae76004e21bd7fa1d02aada71da40a1d2745473 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 07:45:02 +0200 Subject: [PATCH 03/18] Don't run phpunit with the php command --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 751db6f75..bc50fc8c9 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -47,4 +47,4 @@ install: test_script: - cd c:\projects\box - - php bin/phpunit + - bin/phpunit From c5696cf1eb0ebd9225cbe3e9c0c89ec8900869cd Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 08:03:26 +0200 Subject: [PATCH 04/18] Use locally installed composer --- .appveyor.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index bc50fc8c9..015da2cb6 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -15,7 +15,6 @@ environment: cache: - '%LOCALAPPDATA%\Composer\files' - - composer.phar - C:\ProgramData\chocolatey\bin -> .appveyor.yml - C:\ProgramData\chocolatey\lib -> .appveyor.yml - c:\tools\php -> .appveyor.yml @@ -38,12 +37,9 @@ install: - echo extension=php_mbstring.dll >> php.ini - echo extension=php_fileinfo.dll >> php.ini - cd c:\projects\box - - IF NOT EXIST composer.phar (appveyor-retry appveyor DownloadFile https://github.com/composer/composer/releases/download/1.7.1/composer.phar) - - php composer.phar self-update - - IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev) - - IF %dependencies%==lowest appveyor-retry php composer.phar update --prefer-lowest --no-progress --ansi --no-suggest --prefer-dist -n - - IF %dependencies%==current appveyor-retry php composer.phar update --no-progress --ansi --no-suggest --prefer-dist -n - - IF %dependencies%==highest appveyor-retry php composer.phar update --no-progress -n --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==lowest appveyor-retry php bin/composer update --prefer-lowest --no-progress --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==current appveyor-retry php bin/composer install --no-progress --ansi -n + - IF %dependencies%==highest appveyor-retry php bin/composer update --no-progress -n --ansi --no-suggest --prefer-dist -n test_script: - cd c:\projects\box From b74b40cf53a27fa1a20c91d1813de716f25b115c Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 08:03:49 +0200 Subject: [PATCH 05/18] Try running tests with Make --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 015da2cb6..7ae890a58 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -43,4 +43,4 @@ install: test_script: - cd c:\projects\box - - bin/phpunit + - make test From 038c91f0656fb35e9a1a2cec6db3bea167e5c6e3 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 08:06:28 +0200 Subject: [PATCH 06/18] Revert "Use locally installed composer" This reverts commit c5696cf1eb0ebd9225cbe3e9c0c89ec8900869cd. --- .appveyor.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 7ae890a58..e55c93b3d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -15,6 +15,7 @@ environment: cache: - '%LOCALAPPDATA%\Composer\files' + - composer.phar - C:\ProgramData\chocolatey\bin -> .appveyor.yml - C:\ProgramData\chocolatey\lib -> .appveyor.yml - c:\tools\php -> .appveyor.yml @@ -37,9 +38,12 @@ install: - echo extension=php_mbstring.dll >> php.ini - echo extension=php_fileinfo.dll >> php.ini - cd c:\projects\box - - IF %dependencies%==lowest appveyor-retry php bin/composer update --prefer-lowest --no-progress --ansi --no-suggest --prefer-dist -n - - IF %dependencies%==current appveyor-retry php bin/composer install --no-progress --ansi -n - - IF %dependencies%==highest appveyor-retry php bin/composer update --no-progress -n --ansi --no-suggest --prefer-dist -n + - IF NOT EXIST composer.phar (appveyor-retry appveyor DownloadFile https://github.com/composer/composer/releases/download/1.7.1/composer.phar) + - php composer.phar self-update + - IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev) + - IF %dependencies%==lowest appveyor-retry php composer.phar update --prefer-lowest --no-progress --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==current appveyor-retry php composer.phar update --no-progress --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==highest appveyor-retry php composer.phar update --no-progress -n --ansi --no-suggest --prefer-dist -n test_script: - cd c:\projects\box From 832304a2fa22979ee136923d8cf96ae40ce68995 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 08:09:54 +0200 Subject: [PATCH 07/18] Install make --- .appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.appveyor.yml b/.appveyor.yml index e55c93b3d..4740df616 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -30,6 +30,7 @@ install: - IF NOT EXIST c:\php mkdir c:\php - IF NOT EXIST c:\php\%php_ver_target% mkdir c:\php\%php_ver_target% - ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php\%php_ver_target%""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','') + - choco install make - cd c:\tools\php\%php_ver_target% - copy php.ini-production php.ini /Y - echo date.timezone="UTC" >> php.ini From adb5e8b53f2d9cf845565fa929b24cad7f1059ff Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 08:18:32 +0200 Subject: [PATCH 08/18] Revert "Remove composer.bat file and use composer.phar directly" This reverts commit 3fb5c5ce86c5f048c5b21d29c47642a99a9c7347. --- .appveyor.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 4740df616..039751b78 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -39,12 +39,13 @@ install: - echo extension=php_mbstring.dll >> php.ini - echo extension=php_fileinfo.dll >> php.ini - cd c:\projects\box + - echo @php %%~dp0composer.phar %%* > composer.bat - IF NOT EXIST composer.phar (appveyor-retry appveyor DownloadFile https://github.com/composer/composer/releases/download/1.7.1/composer.phar) - php composer.phar self-update - IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev) - - IF %dependencies%==lowest appveyor-retry php composer.phar update --prefer-lowest --no-progress --ansi --no-suggest --prefer-dist -n - - IF %dependencies%==current appveyor-retry php composer.phar update --no-progress --ansi --no-suggest --prefer-dist -n - - IF %dependencies%==highest appveyor-retry php composer.phar update --no-progress -n --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==lowest appveyor-retry composer update --prefer-lowest --no-progress --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==current appveyor-retry composer update --no-progress --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==highest appveyor-retry composer update --no-progress -n --ansi --no-suggest --prefer-dist -n test_script: - cd c:\projects\box From 7ba6b4f0ac5ed17ebbca27bb0c8d1f2d17532fcb Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 08:21:17 +0200 Subject: [PATCH 09/18] Remove make --- .appveyor.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 039751b78..4c13a28bd 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -30,7 +30,6 @@ install: - IF NOT EXIST c:\php mkdir c:\php - IF NOT EXIST c:\php\%php_ver_target% mkdir c:\php\%php_ver_target% - ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php\%php_ver_target%""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','') - - choco install make - cd c:\tools\php\%php_ver_target% - copy php.ini-production php.ini /Y - echo date.timezone="UTC" >> php.ini @@ -49,4 +48,4 @@ install: test_script: - cd c:\projects\box - - make test + - bin\phpunit From e316b626158048028a6220a688b0cd6acc62d196 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 08:21:19 +0200 Subject: [PATCH 10/18] Revert "Revert "Remove composer.bat file and use composer.phar directly"" This reverts commit adb5e8b53f2d9cf845565fa929b24cad7f1059ff. --- .appveyor.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 4c13a28bd..d0dd5d422 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -38,13 +38,12 @@ install: - echo extension=php_mbstring.dll >> php.ini - echo extension=php_fileinfo.dll >> php.ini - cd c:\projects\box - - echo @php %%~dp0composer.phar %%* > composer.bat - IF NOT EXIST composer.phar (appveyor-retry appveyor DownloadFile https://github.com/composer/composer/releases/download/1.7.1/composer.phar) - php composer.phar self-update - IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev) - - IF %dependencies%==lowest appveyor-retry composer update --prefer-lowest --no-progress --ansi --no-suggest --prefer-dist -n - - IF %dependencies%==current appveyor-retry composer update --no-progress --ansi --no-suggest --prefer-dist -n - - IF %dependencies%==highest appveyor-retry composer update --no-progress -n --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==lowest appveyor-retry php composer.phar update --prefer-lowest --no-progress --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==current appveyor-retry php composer.phar update --no-progress --ansi --no-suggest --prefer-dist -n + - IF %dependencies%==highest appveyor-retry php composer.phar update --no-progress -n --ansi --no-suggest --prefer-dist -n test_script: - cd c:\projects\box From 0d29352ee509fb76097f874d3f4a8e2458944741 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 08:25:14 +0200 Subject: [PATCH 11/18] Only install dependencies from lock file --- .appveyor.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index d0dd5d422..38b14fbcd 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -6,12 +6,8 @@ version: '{build}.{branch}' environment: matrix: - - dependencies: lowest - php_ver_target: 7.1 - - dependencies: current - php_ver_target: 7.2 - - dependencies: highest - php_ver_target: 7.3 + - php_ver_target: 7.1 + - php_ver_target: 7.2 cache: - '%LOCALAPPDATA%\Composer\files' @@ -41,9 +37,7 @@ install: - IF NOT EXIST composer.phar (appveyor-retry appveyor DownloadFile https://github.com/composer/composer/releases/download/1.7.1/composer.phar) - php composer.phar self-update - IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev) - - IF %dependencies%==lowest appveyor-retry php composer.phar update --prefer-lowest --no-progress --ansi --no-suggest --prefer-dist -n - - IF %dependencies%==current appveyor-retry php composer.phar update --no-progress --ansi --no-suggest --prefer-dist -n - - IF %dependencies%==highest appveyor-retry php composer.phar update --no-progress -n --ansi --no-suggest --prefer-dist -n + - appveyor-retry php composer.phar install --no-interaction --no-progress --no-suggest --prefer-dist test_script: - cd c:\projects\box From 8d2d8f74d0733fab984f2339beb0bc549576f4b1 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 08:26:06 +0200 Subject: [PATCH 12/18] Change php_ver_target to PHP_VERSION --- .appveyor.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 38b14fbcd..c967a8864 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -6,8 +6,8 @@ version: '{build}.{branch}' environment: matrix: - - php_ver_target: 7.1 - - php_ver_target: 7.2 + - PHP_VERSION: 7.1 + - PHP_VERSION: 7.2 cache: - '%LOCALAPPDATA%\Composer\files' @@ -17,16 +17,16 @@ cache: - c:\tools\php -> .appveyor.yml init: - - SET PATH=C:\Program Files\OpenSSL;c:\tools\php\%php_ver_target%;%PATH% + - SET PATH=C:\Program Files\OpenSSL;c:\tools\php\%PHP_VERSION%;%PATH% - SET COMPOSER_NO_INTERACTION=1 - SET ANSICON=121x90 (121x90) - REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f install: - IF NOT EXIST c:\php mkdir c:\php - - IF NOT EXIST c:\php\%php_ver_target% mkdir c:\php\%php_ver_target% - - ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php\%php_ver_target%""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','') - - cd c:\tools\php\%php_ver_target% + - IF NOT EXIST c:\php\%PHP_VERSION% mkdir c:\php\%PHP_VERSION% + - ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php\%PHP_VERSION%""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:PHP_VERSION | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','') + - cd c:\tools\php\%PHP_VERSION% - copy php.ini-production php.ini /Y - echo date.timezone="UTC" >> php.ini - echo extension_dir=ext >> php.ini From cb957eda0e25d1491c2846496ef1f71344f2cd7d Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 08:44:38 +0200 Subject: [PATCH 13/18] Change root directory in ConfigurationFileTest --- tests/ConfigurationFileTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ConfigurationFileTest.php b/tests/ConfigurationFileTest.php index f93cd899c..09e7d9b38 100644 --- a/tests/ConfigurationFileTest.php +++ b/tests/ConfigurationFileTest.php @@ -1126,7 +1126,7 @@ public function test_the_blacklist_input_may_refer_to_non_existent_paths(): void { $this->setConfig([ 'blacklist' => [ - '/nowhere', + ($this->isWindows() ? 'C:' : '') . '/nowhere', ], ]); From e9f0c57dd3dcaa88f7d3cddbf66546d20c2948c0 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 09:25:58 +0200 Subject: [PATCH 14/18] Update directory separator in ComposerConfigurationTest --- tests/Composer/ComposerConfigurationTest.php | 32 +++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/tests/Composer/ComposerConfigurationTest.php b/tests/Composer/ComposerConfigurationTest.php index 3b9e445db..ce1fa3214 100644 --- a/tests/Composer/ComposerConfigurationTest.php +++ b/tests/Composer/ComposerConfigurationTest.php @@ -217,6 +217,8 @@ class ComposerConfigurationTest extends FileSystemTestCase } JSON; + private $ds = DIRECTORY_SEPARATOR; + public function test_it_returns_an_empty_list_when_trying_to_retrieve_the_list_of_dev_packages_when_no_composer_json_file_is_found(): void { $this->assertSame([], ComposerConfiguration::retrieveDevPackages($this->tmp, null, null)); @@ -228,12 +230,12 @@ public function test_it_can_retrieve_the_dev_packages_found_in_the_lock_file(): $decodedComposerJson = []; $decodedComposerLock = json_decode(self::COMPOSER_LOCK_SAMPLE, true); - mkdir('vendor/bamarni/composer-bin-plugin'); - mkdir('vendor/doctrine/instantiator'); + mkdir("vendor{$this->ds}bamarni{$this->ds}composer-bin-plugin"); + mkdir("vendor{$this->ds}doctrine{$this->ds}instantiator"); $expected = [ - $this->tmp.'/vendor/bamarni/composer-bin-plugin', - $this->tmp.'/vendor/doctrine/instantiator', + $this->tmp."{$this->ds}vendor{$this->ds}bamarni{$this->ds}composer-bin-plugin", + $this->tmp."{$this->ds}vendor{$this->ds}doctrine{$this->ds}instantiator", ]; $actual = ComposerConfiguration::retrieveDevPackages($this->tmp, $decodedComposerJson, $decodedComposerLock); @@ -246,12 +248,12 @@ public function test_it_can_retrieve_the_dev_packages_found_in_the_lock_file_2() $decodedComposerJson = ['config' => []]; $decodedComposerLock = json_decode(self::COMPOSER_LOCK_SAMPLE, true); - mkdir('vendor/bamarni/composer-bin-plugin'); - mkdir('vendor/doctrine/instantiator'); + mkdir("vendor{$this->ds}bamarni{$this->ds}composer-bin-plugin"); + mkdir("vendor{$this->ds}doctrine{$this->ds}instantiator"); $expected = [ - $this->tmp.'/vendor/bamarni/composer-bin-plugin', - $this->tmp.'/vendor/doctrine/instantiator', + $this->tmp."{$this->ds}vendor{$this->ds}bamarni{$this->ds}composer-bin-plugin", + $this->tmp."{$this->ds}vendor{$this->ds}doctrine{$this->ds}instantiator", ]; $actual = ComposerConfiguration::retrieveDevPackages($this->tmp, $decodedComposerJson, $decodedComposerLock); @@ -264,11 +266,11 @@ public function test_it_ignores_non_existent_dev_packages_found_in_the_lock_file $decodedComposerJson = []; $decodedComposerLock = json_decode(self::COMPOSER_LOCK_SAMPLE, true); - mkdir('vendor/bamarni/composer-bin-plugin'); + mkdir("vendor{$this->ds}bamarni{$this->ds}composer-bin-plugin"); // Doctrine Instantiator vendor does not exists $expected = [ - $this->tmp.'/vendor/bamarni/composer-bin-plugin', + $this->tmp."{$this->ds}vendor{$this->ds}bamarni{$this->ds}composer-bin-plugin", ]; $actual = ComposerConfiguration::retrieveDevPackages($this->tmp, $decodedComposerJson, $decodedComposerLock); @@ -285,11 +287,11 @@ public function test_it_can_retrieve_the_dev_packages_found_in_the_lock_file_in_ ]; $decodedComposerLock = json_decode(self::COMPOSER_LOCK_SAMPLE, true); - mkdir('custom-vendor/bamarni/composer-bin-plugin'); - mkdir('vendor/doctrine/instantiator'); // Wrong directory + mkdir("custom-vendor{$this->ds}bamarni{$this->ds}composer-bin-plugin"); + mkdir("vendor{$this->ds}doctrine{$this->ds}instantiator"); // Wrong directory $expected = [ - $this->tmp.'/custom-vendor/bamarni/composer-bin-plugin', + $this->tmp."{$this->ds}custom-vendor{$this->ds}bamarni{$this->ds}composer-bin-plugin", ]; $actual = ComposerConfiguration::retrieveDevPackages($this->tmp, $decodedComposerJson, $decodedComposerLock); @@ -404,8 +406,8 @@ public function test_it_can_retrieve_the_dev_packages_found_in_the_lock_file_eve true ); - mkdir('custom-vendor/bamarni/composer-bin-plugin'); - mkdir('vendor/doctrine/instantiator'); // Wrong directory + mkdir("custom-vendor{$this->ds}bamarni{$this->ds}composer-bin-plugin"); + mkdir("vendor{$this->ds}doctrine{$this->ds}instantiator"); // Wrong directory $expected = []; From 381452bd5a344f001dce225bff8a69a9633d1bf5 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 09:31:37 +0200 Subject: [PATCH 15/18] Add bzip2 extension --- .appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.appveyor.yml b/.appveyor.yml index c967a8864..9b400ac3f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -33,6 +33,7 @@ install: - echo extension=php_openssl.dll >> php.ini - echo extension=php_mbstring.dll >> php.ini - echo extension=php_fileinfo.dll >> php.ini + - echo extension=php_bz2.dll >> php.ini - cd c:\projects\box - IF NOT EXIST composer.phar (appveyor-retry appveyor DownloadFile https://github.com/composer/composer/releases/download/1.7.1/composer.phar) - php composer.phar self-update From 1cb891c3d5a8becfa8a5d006a65a634930b05ddf Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 10:06:37 +0200 Subject: [PATCH 16/18] Normalize directory separator --- src/Test/FileSystemTestCase.php | 7 ++++++- tests/Composer/ComposerConfigurationTest.php | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Test/FileSystemTestCase.php b/src/Test/FileSystemTestCase.php index 773f503d9..537bc402f 100644 --- a/src/Test/FileSystemTestCase.php +++ b/src/Test/FileSystemTestCase.php @@ -34,6 +34,11 @@ abstract class FileSystemTestCase extends TestCase */ protected $tmp; + /** + * @var string + */ + protected $ds = DIRECTORY_SEPARATOR; + /** * {@inheritdoc} */ @@ -75,7 +80,7 @@ final protected function normalizePaths(array $files): array $files = array_values( array_map( function (string $file) use ($root): string { - return str_replace($root.DIRECTORY_SEPARATOR, '', $file); + return str_replace([$root.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR], ['', '/'], $file); }, $files ) diff --git a/tests/Composer/ComposerConfigurationTest.php b/tests/Composer/ComposerConfigurationTest.php index ce1fa3214..d86ccc8e4 100644 --- a/tests/Composer/ComposerConfigurationTest.php +++ b/tests/Composer/ComposerConfigurationTest.php @@ -217,8 +217,6 @@ class ComposerConfigurationTest extends FileSystemTestCase } JSON; - private $ds = DIRECTORY_SEPARATOR; - public function test_it_returns_an_empty_list_when_trying_to_retrieve_the_list_of_dev_packages_when_no_composer_json_file_is_found(): void { $this->assertSame([], ComposerConfiguration::retrieveDevPackages($this->tmp, null, null)); From b6cef2fb2c72ef3125afeab7639aa3c56ae6bed6 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 10:25:30 +0200 Subject: [PATCH 17/18] Normalize paths for RequirementsDumperTest --- tests/RequirementChecker/RequirementsDumperTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/RequirementChecker/RequirementsDumperTest.php b/tests/RequirementChecker/RequirementsDumperTest.php index 0abfeba09..0c7c9e644 100644 --- a/tests/RequirementChecker/RequirementsDumperTest.php +++ b/tests/RequirementChecker/RequirementsDumperTest.php @@ -14,14 +14,14 @@ namespace KevinGH\Box\RequirementChecker; +use KevinGH\Box\Test\FileSystemTestCase; use Phar; -use PHPUnit\Framework\TestCase; use function array_column; /** * @covers \KevinGH\Box\RequirementChecker\RequirementsDumper */ -class RequirementsDumperTest extends TestCase +class RequirementsDumperTest extends FileSystemTestCase { /** * @dataProvider provideJsonAndLockContents @@ -75,7 +75,7 @@ public function test_it_dumps_the_requirement_checker_files( $this->assertSame( $expectedFiles, - array_column($checkFiles, 0) + $this->normalizePaths(array_column($checkFiles, 0)) ); $this->assertSame($expectedRequirement, $checkFiles[0][1]); From f4e9bde150ae8373b3f608da1749a18ca93a89f1 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Wed, 12 Sep 2018 10:43:04 +0200 Subject: [PATCH 18/18] Remove ANSICON --- .appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 9b400ac3f..5892aabc1 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -19,7 +19,6 @@ cache: init: - SET PATH=C:\Program Files\OpenSSL;c:\tools\php\%PHP_VERSION%;%PATH% - SET COMPOSER_NO_INTERACTION=1 - - SET ANSICON=121x90 (121x90) - REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1 /f install: