Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -42,19 +42,22 @@
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"johnpbloch/wordpress-core-installer": true
"johnpbloch/wordpress-core-installer": true,
"phpstan/extension-installer": true
}
},
"scripts": {
"behat": "run-behat-tests",
"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"
]
Expand Down
6 changes: 5 additions & 1 deletion tests/Test_Arguments.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

use cli\Arguments;
use PHPUnit\Framework\Attributes\DataProvider;
use WP_CLI\Tests\TestCase;

/**
Expand Down Expand Up @@ -255,6 +255,7 @@ private function _testParse($cliParams, $expectedValues)
*
* @dataProvider settingsWithValidOptions
*/
#[DataProvider( 'settingsWithValidOptions' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
public function testParseWithValidOptions($cliParams, $expectedValues)
{
$this->_testParse($cliParams, $expectedValues);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/Test_Colors.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down