diff --git a/composer.json b/composer.json index d1ed748..b6da739 100644 --- a/composer.json +++ b/composer.json @@ -22,11 +22,11 @@ }, "require-dev": { "roave/security-advisories": "dev-latest", - "wp-cli/wp-cli-tests": "^4" + "wp-cli/wp-cli-tests": "^5" }, "extra": { "branch-alias": { - "dev-master": "0.11.x-dev" + "dev-master": "0.12.x-dev" } }, "minimum-stability": "dev", @@ -42,7 +42,8 @@ "config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true, - "johnpbloch/wordpress-core-installer": true + "johnpbloch/wordpress-core-installer": true, + "phpstan/extension-installer": true } }, "scripts": { @@ -50,11 +51,13 @@ "behat-rerun": "rerun-behat-tests", "lint": "run-linter-tests", "phpcs": "run-phpcs-tests", + "phpstan": "run-phpstan-tests", "phpunit": "run-php-unit-tests", "prepare-tests": "install-package-tests", "test": [ "@lint", "@phpcs", + "@phpstan", "@phpunit", "@behat" ] diff --git a/tests/Test_Arguments.php b/tests/Test_Arguments.php index 9f89eda..2201849 100644 --- a/tests/Test_Arguments.php +++ b/tests/Test_Arguments.php @@ -1,6 +1,6 @@ _testParse($cliParams, $expectedValues); @@ -265,6 +266,7 @@ public function testParseWithValidOptions($cliParams, $expectedValues) * @param array $expectedValues expected values after parsing * @dataProvider settingsWithMissingOptions */ + #[DataProvider( 'settingsWithMissingOptions' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound public function testParseWithMissingOptions($cliParams, $expectedValues) { $this->expectException(\Exception::class); @@ -277,6 +279,7 @@ public function testParseWithMissingOptions($cliParams, $expectedValues) * @param array $expectedValues expected values after parsing * @dataProvider settingsWithMissingOptionsWithDefault */ + #[DataProvider( 'settingsWithMissingOptionsWithDefault' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound public function testParseWithMissingOptionsWithDefault($cliParams, $expectedValues) { $this->_testParse($cliParams, $expectedValues); @@ -287,6 +290,7 @@ public function testParseWithMissingOptionsWithDefault($cliParams, $expectedValu * @param array $expectedValues expected values after parsing * @dataProvider settingsWithNoOptionsWithDefault */ + #[DataProvider( 'settingsWithNoOptionsWithDefault' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound public function testParseWithNoOptionsWithDefault($cliParams, $expectedValues) { $this->_testParse($cliParams, $expectedValues); } diff --git a/tests/Test_Colors.php b/tests/Test_Colors.php index bac23a4..b7d28ff 100644 --- a/tests/Test_Colors.php +++ b/tests/Test_Colors.php @@ -2,12 +2,14 @@ use cli\Colors; use WP_CLI\Tests\TestCase; +use PHPUnit\Framework\Attributes\DataProvider; class Test_Colors extends TestCase { /** * @dataProvider dataColors */ + #[DataProvider( 'dataColors' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound public function testColors( $str, $color ) { // Colors enabled. Colors::enable( true );