Skip to content

Commit bb52588

Browse files
authored
Merge pull request #204 from wp-cli/dependabot/composer/wp-cli/wp-cli-tests-tw-5
2 parents 1528565 + 3086300 commit bb52588

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818
},
1919
"require-dev": {
2020
"wp-cli/scaffold-command": "^1 || ^2",
21-
"wp-cli/wp-cli-tests": "^4"
21+
"wp-cli/wp-cli-tests": "^5"
2222
},
2323
"config": {
2424
"process-timeout": 7200,
2525
"sort-packages": true,
2626
"allow-plugins": {
2727
"dealerdirect/phpcodesniffer-composer-installer": true,
28-
"johnpbloch/wordpress-core-installer": true
28+
"johnpbloch/wordpress-core-installer": true,
29+
"phpstan/extension-installer": true
2930
},
3031
"lock": false
3132
},
@@ -58,12 +59,14 @@
5859
"behat-rerun": "rerun-behat-tests",
5960
"lint": "run-linter-tests",
6061
"phpcs": "run-phpcs-tests",
62+
"phpstan": "run-phpstan-tests",
6163
"phpcbf": "run-phpcbf-cleanup",
6264
"phpunit": "run-php-unit-tests",
6365
"prepare-tests": "install-package-tests",
6466
"test": [
6567
"@lint",
6668
"@phpcs",
69+
"@phpstan",
6770
"@phpunit",
6871
"@behat"
6972
]

tests/JsonManipulatorTest.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212

1313
use WP_CLI\JsonManipulator; // WP_CLI
1414
use WP_CLI\Tests\TestCase;
15+
use PHPUnit\Framework\Attributes\DataProvider;
1516

1617
class JsonManipulatorTest extends TestCase
1718
{
1819

1920
/**
2021
* @dataProvider linkProvider
2122
*/
23+
#[DataProvider( 'linkProvider' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
2224
public function testAddLink($json, $type, $package, $constraint, $expected)
2325
{
2426
$manipulator = new JsonManipulator($json);
@@ -1290,6 +1292,7 @@ public static function linkProvider()
12901292
/**
12911293
* @dataProvider providerAddLinkAndSortPackages
12921294
*/
1295+
#[DataProvider( 'providerAddLinkAndSortPackages' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
12931296
public function testAddLinkAndSortPackages($json, $type, $package, $constraint, $sortPackages, $expected)
12941297
{
12951298
$manipulator = new JsonManipulator($json);
@@ -1370,6 +1373,7 @@ public static function providerAddLinkAndSortPackages()
13701373
/**
13711374
* @dataProvider removeSubNodeProvider
13721375
*/
1376+
#[DataProvider( 'removeSubNodeProvider' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
13731377
public function testRemoveSubNode($json, $name, $expected, $expectedContent = null)
13741378
{
13751379
$manipulator = new JsonManipulator($json);
@@ -1601,10 +1605,6 @@ public static function removeSubNodeProvider()
16011605
}
16021606
}
16031607
}
1604-
',
1605-
1606-
'{
1607-
}
16081608
',
16091609
),
16101610
'works on deep repos with borked texts2' => array(
@@ -1624,10 +1624,6 @@ public static function removeSubNodeProvider()
16241624
}
16251625
}
16261626
}
1627-
',
1628-
1629-
'{
1630-
}
16311627
',
16321628
),
16331629
'fails on deep arrays with borked texts' => array(
@@ -2367,6 +2363,7 @@ public function testRemoveMainKeyAtEndOfFile()
23672363
/**
23682364
* @dataProvider providerAddLinkCaseInsensitive
23692365
*/
2366+
#[DataProvider( 'providerAddLinkCaseInsensitive' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
23702367
public function testAddLinkCaseInsensitive($json, $type, $package, $constraint, $sortPackages, $expected)
23712368
{
23722369
$manipulator = new JsonManipulator($json);
@@ -2433,6 +2430,7 @@ public static function providerAddLinkCaseInsensitive()
24332430
/**
24342431
* @dataProvider providerAddSubNodeCase
24352432
*/
2433+
#[DataProvider( 'providerAddSubNodeCase' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
24362434
public function testAddSubNodeCase($json, $mainNode, $name, $caseInsensitive, $expected)
24372435
{
24382436
$manipulator = new JsonManipulator($json);
@@ -2494,6 +2492,7 @@ public static function providerAddSubNodeCase()
24942492
/**
24952493
* @dataProvider providerRemoveSubNodeCaseInsensitive
24962494
*/
2495+
#[DataProvider( 'providerRemoveSubNodeCaseInsensitive' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
24972496
public function testRemoveSubNodeCaseInsensitive($json, $mainNode, $name, $expected, $expectedContent = null)
24982497
{
24992498
$manipulator = new JsonManipulator($json);

0 commit comments

Comments
 (0)