Skip to content

Commit 3be67d9

Browse files
authored
Update wp-cli-tests to v5 (#187)
1 parent cd6be7a commit 3be67d9

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
},
2323
"require-dev": {
2424
"roave/security-advisories": "dev-latest",
25-
"wp-cli/wp-cli-tests": "^4"
25+
"wp-cli/wp-cli-tests": "^5"
2626
},
2727
"extra": {
2828
"branch-alias": {
29-
"dev-master": "0.11.x-dev"
29+
"dev-master": "0.12.x-dev"
3030
}
3131
},
3232
"minimum-stability": "dev",
@@ -42,19 +42,22 @@
4242
"config": {
4343
"allow-plugins": {
4444
"dealerdirect/phpcodesniffer-composer-installer": true,
45-
"johnpbloch/wordpress-core-installer": true
45+
"johnpbloch/wordpress-core-installer": true,
46+
"phpstan/extension-installer": true
4647
}
4748
},
4849
"scripts": {
4950
"behat": "run-behat-tests",
5051
"behat-rerun": "rerun-behat-tests",
5152
"lint": "run-linter-tests",
5253
"phpcs": "run-phpcs-tests",
54+
"phpstan": "run-phpstan-tests",
5355
"phpunit": "run-php-unit-tests",
5456
"prepare-tests": "install-package-tests",
5557
"test": [
5658
"@lint",
5759
"@phpcs",
60+
"@phpstan",
5861
"@phpunit",
5962
"@behat"
6063
]

tests/Test_Arguments.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use cli\Arguments;
3+
use PHPUnit\Framework\Attributes\DataProvider;
44
use WP_CLI\Tests\TestCase;
55

66
/**
@@ -255,6 +255,7 @@ private function _testParse($cliParams, $expectedValues)
255255
*
256256
* @dataProvider settingsWithValidOptions
257257
*/
258+
#[DataProvider( 'settingsWithValidOptions' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
258259
public function testParseWithValidOptions($cliParams, $expectedValues)
259260
{
260261
$this->_testParse($cliParams, $expectedValues);
@@ -265,6 +266,7 @@ public function testParseWithValidOptions($cliParams, $expectedValues)
265266
* @param array $expectedValues expected values after parsing
266267
* @dataProvider settingsWithMissingOptions
267268
*/
269+
#[DataProvider( 'settingsWithMissingOptions' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
268270
public function testParseWithMissingOptions($cliParams, $expectedValues)
269271
{
270272
$this->expectException(\Exception::class);
@@ -277,6 +279,7 @@ public function testParseWithMissingOptions($cliParams, $expectedValues)
277279
* @param array $expectedValues expected values after parsing
278280
* @dataProvider settingsWithMissingOptionsWithDefault
279281
*/
282+
#[DataProvider( 'settingsWithMissingOptionsWithDefault' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
280283
public function testParseWithMissingOptionsWithDefault($cliParams, $expectedValues)
281284
{
282285
$this->_testParse($cliParams, $expectedValues);
@@ -287,6 +290,7 @@ public function testParseWithMissingOptionsWithDefault($cliParams, $expectedValu
287290
* @param array $expectedValues expected values after parsing
288291
* @dataProvider settingsWithNoOptionsWithDefault
289292
*/
293+
#[DataProvider( 'settingsWithNoOptionsWithDefault' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
290294
public function testParseWithNoOptionsWithDefault($cliParams, $expectedValues) {
291295
$this->_testParse($cliParams, $expectedValues);
292296
}

tests/Test_Colors.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
use cli\Colors;
44
use WP_CLI\Tests\TestCase;
5+
use PHPUnit\Framework\Attributes\DataProvider;
56

67
class Test_Colors extends TestCase {
78

89
/**
910
* @dataProvider dataColors
1011
*/
12+
#[DataProvider( 'dataColors' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
1113
public function testColors( $str, $color ) {
1214
// Colors enabled.
1315
Colors::enable( true );

0 commit comments

Comments
 (0)