Skip to content

Commit 741f7db

Browse files
committed
Fix unit tests
1 parent 390b699 commit 741f7db

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

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)