diff --git a/.github/workflows/integrationtest.yml b/.github/workflows/integrationtest.yml index 499c670..4e78825 100644 --- a/.github/workflows/integrationtest.yml +++ b/.github/workflows/integrationtest.yml @@ -41,31 +41,17 @@ jobs: - '8.4' - '8.5' composer: - - 'v1' - 'v2' os: - 'ubuntu-latest' - 'windows-latest' exclude: - # Exclude a particularly problematic build. - # @link https://github.com/PHPCSStandards/composer-installer/issues/181 - - php: '5.5' - composer: 'v1' - os: 'windows-latest' # Installing on Windows with PHP 5.4 runs into all sorts of problems (which are not ours). # Considering PHP 5.4 is ancient, I deem it acceptable to exclude the Windows PHP 5.4 builds. # @link https://github.com/PHPCSStandards/composer-installer/pull/213 - php: '5.4' os: 'windows-latest' - # Composer 1.x is no longer supported and while Composer 2.2 is an LTS version, the LTS - # is only for critical bugs and security issues, not for supporting new PHP versions. - # In practice, this means that Composer 1.x and 2.2 are not compatible with PHP 8.4 and later. - # @link https://github.com/composer/composer/issues/10340 - - php: '8.4' - composer: 'v1' - - php: '8.5' - composer: 'v1' include: # Composer 2.3 drops support for PHP < 7.2, so for PHP 5.4 to 7.1, `v2` will install diff --git a/.github/workflows/quicktest.yml b/.github/workflows/quicktest.yml index bec996b..075d95b 100644 --- a/.github/workflows/quicktest.yml +++ b/.github/workflows/quicktest.yml @@ -32,14 +32,15 @@ jobs: - '7.2' - 'latest' composer: - - 'v1' + # Note: for PHP 5.4 - 7.1, "v2" will install Composer 2.2. + # For PHP 7.2+, it will install Composer "latest". - 'v2' os: - 'ubuntu-latest' - 'windows-latest' # Installing on Windows with PHP 5.4 runs into all sorts of problems (which are not ours). - # Exclude the Windows PHP 5.4 builds and replace them with PHP 5.5/5.6 for the same. + # Exclude the Windows PHP 5.4 builds and replace them with PHP 5.5 for the same. # @link https://github.com/PHPCSStandards/composer-installer/issues/181 # @link https://github.com/PHPCSStandards/composer-installer/pull/213 exclude: @@ -47,10 +48,6 @@ jobs: os: 'windows-latest' include: - php: '5.5' - composer: 'v2' - os: 'windows-latest' - - php: '5.6' - composer: 'v1' os: 'windows-latest' name: "Quick test" diff --git a/README.md b/README.md index d76441a..b4f988c 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ That's it. This plugin is compatible with: - PHP **5.4+**, **7.x**, and **8.x** (Support for PHP v8 is available since [`v0.7.0`][v0.7]) -- [Composer][composer] **1.x** and **2.x** (Support for Composer v2 is available since [`v0.7.0`][v0.7]) +- [Composer][composer] **2.x** - [PHP_CodeSniffer][codesniffer] **2.x** and **3.x** (Support for PHP_CodeSniffer v3 is available since [`v0.4.0`][v0.4]) ### How it works diff --git a/composer.json b/composer.json index 70eee98..7e636db 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ }, "require": { "php": ">=5.4", - "composer-plugin-api": "^1.0 || ^2.0", + "composer-plugin-api": "^2.0", "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { diff --git a/tests/IntegrationTest/BaseLineTest.php b/tests/IntegrationTest/BaseLineTest.php index 16df447..ab1b8fc 100644 --- a/tests/IntegrationTest/BaseLineTest.php +++ b/tests/IntegrationTest/BaseLineTest.php @@ -108,18 +108,6 @@ public function testBaseLineGlobal($phpcsVersion, $expectedStnds) */ public function testBaseLineLocal($phpcsVersion, $expectedStnds) { - if ( - $phpcsVersion === PHPCSVersions::MASTER - && \CLI_PHP_MINOR === '5.5' - && $this->onWindows() === true - && substr(\COMPOSER_VERSION, 0, 1) === '1' - ) { - $this->markTestSkipped( - 'Composer 1.x on Windows with PHP 5.5 does run the plugin when there are no external standards,' - . ' but doesn\'t consistently show this in the logs' - ); - } - $config = $this->composerConfig; $config['require-dev']['squizlabs/php_codesniffer'] = $phpcsVersion; diff --git a/tests/IntegrationTest/RemovePluginTest.php b/tests/IntegrationTest/RemovePluginTest.php index 02ffd0c..0d1068e 100644 --- a/tests/IntegrationTest/RemovePluginTest.php +++ b/tests/IntegrationTest/RemovePluginTest.php @@ -56,24 +56,6 @@ protected function tear_down() $this->removeTestEnvironment(); } - /** - * Helper method to get the stdout expectation for when the plugin is uninstalled. - * - * As of Composer 2.0.0, plugins which have been uninstalled will not run anymore - * after the uninstall (which is good). - * It is unclear which particular change this can be attributed to. - * - * @return string - */ - private function getUninstallStdOutExpectation() - { - if (strpos(\COMPOSER_VERSION, '1') === 0) { - return Plugin::MESSAGE_PLUGIN_UNINSTALLED; - } - - return ''; - } - /** * Test the plugin doesn't exit with a non-0 exit code and doesn't throw errors when PHPCS and the plugin * were installed via --dev and a no-dev install is run, which removes the plugin and PHPCS. @@ -101,7 +83,7 @@ public function testRemovePHPCSViaNoDevGlobal() $this->assertExecute( 'composer global install --no-dev -v --no-ansi', 0, // Expected exit code. - $this->getUninstallStdOutExpectation(), // Expected stdout. + null, // No stdout expectation. null, // No stderr expectation. 'Uninstall by switching to no-dev did not meet expectations.' ); @@ -133,7 +115,7 @@ public function testRemovePHPCSViaNoDevLocal() $this->assertExecute( sprintf('composer install --no-dev -v --no-ansi --working-dir=%s', escapeshellarg(static::$tempLocalPath)), 0, // Expected exit code. - $this->getUninstallStdOutExpectation(), // Expected stdout. + null, // No stdout expectation. null, // No stderr expectation. 'Uninstall by switching to no-dev did not meet expectations.' ); @@ -166,7 +148,7 @@ public function testRemovePHPCSViaDevUninstallGlobal() $this->assertExecute( 'composer global remove --dev phpcs-composer-installer/multistandard -v --no-ansi', 0, // Expected exit code. - $this->getUninstallStdOutExpectation(), // Expected stdout. + null, // No stdout expectation. null, // No stderr expectation. 'Uninstall of dev dependency did not meet expectations.' ); @@ -203,7 +185,7 @@ public function testRemovePHPCSViaDevUninstallLocal() $this->assertExecute( $command, 0, // Expected exit code. - $this->getUninstallStdOutExpectation(), // Expected stdout. + null, // No stdout expectation. null, // No stderr expectation. 'Uninstall of dev dependency did not meet expectations.' ); @@ -236,7 +218,7 @@ public function testRemovePHPCSViaNoDevUninstallGlobal() $this->assertExecute( 'composer global remove phpcs-composer-installer/multistandard -v --no-ansi', 0, // Expected exit code. - $this->getUninstallStdOutExpectation(), // Expected stdout. + null, // No stdout expectation. null, // No stderr expectation. 'Uninstall of no-dev dependency did not meet expectations.' ); @@ -273,7 +255,7 @@ public function testRemovePHPCSViaNoDevUninstallLocal() $this->assertExecute( $command, 0, // Expected exit code. - $this->getUninstallStdOutExpectation(), // Expected stdout. + null, // No stdout expectation. null, // No stderr expectation. 'Uninstall of no-dev dependency did not meet expectations.' ); diff --git a/tests/TestCase.php b/tests/TestCase.php index a477311..2c42008 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -252,14 +252,6 @@ protected static function writeComposerJsonFile($config, $directory) $config['config']['allow-plugins']['dealerdirect/phpcodesniffer-composer-installer'] = true; } - /* - * Disable TLS when on Windows with Composer 1.x and PHP 5.4. - * @link https://github.com/composer/composer/issues/10495 - */ - if (static::onWindows() === true && \CLI_PHP_MINOR === '5.4' && strpos(\COMPOSER_VERSION, '1') === 0) { - $config['config']['disable-tls'] = true; - } - $encoded = json_encode($config, \JSON_UNESCAPED_SLASHES | \JSON_PRETTY_PRINT); if (json_last_error() !== \JSON_ERROR_NONE || $encoded === false) { throw new RuntimeException('Provided configuration can not be encoded to valid JSON');