|
12 | 12 |
|
13 | 13 | use WP_CLI\JsonManipulator; // WP_CLI |
14 | 14 | use WP_CLI\Tests\TestCase; |
| 15 | +use PHPUnit\Framework\Attributes\DataProvider; |
15 | 16 |
|
16 | 17 | class JsonManipulatorTest extends TestCase |
17 | 18 | { |
18 | 19 |
|
19 | 20 | /** |
20 | 21 | * @dataProvider linkProvider |
21 | 22 | */ |
| 23 | + #[DataProvider( 'linkProvider' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound |
22 | 24 | public function testAddLink($json, $type, $package, $constraint, $expected) |
23 | 25 | { |
24 | 26 | $manipulator = new JsonManipulator($json); |
@@ -1290,6 +1292,7 @@ public static function linkProvider() |
1290 | 1292 | /** |
1291 | 1293 | * @dataProvider providerAddLinkAndSortPackages |
1292 | 1294 | */ |
| 1295 | + #[DataProvider( 'providerAddLinkAndSortPackages' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound |
1293 | 1296 | public function testAddLinkAndSortPackages($json, $type, $package, $constraint, $sortPackages, $expected) |
1294 | 1297 | { |
1295 | 1298 | $manipulator = new JsonManipulator($json); |
@@ -1370,6 +1373,7 @@ public static function providerAddLinkAndSortPackages() |
1370 | 1373 | /** |
1371 | 1374 | * @dataProvider removeSubNodeProvider |
1372 | 1375 | */ |
| 1376 | + #[DataProvider( 'removeSubNodeProvider' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound |
1373 | 1377 | public function testRemoveSubNode($json, $name, $expected, $expectedContent = null) |
1374 | 1378 | { |
1375 | 1379 | $manipulator = new JsonManipulator($json); |
@@ -2367,6 +2371,7 @@ public function testRemoveMainKeyAtEndOfFile() |
2367 | 2371 | /** |
2368 | 2372 | * @dataProvider providerAddLinkCaseInsensitive |
2369 | 2373 | */ |
| 2374 | + #[DataProvider( 'providerAddLinkCaseInsensitive' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound |
2370 | 2375 | public function testAddLinkCaseInsensitive($json, $type, $package, $constraint, $sortPackages, $expected) |
2371 | 2376 | { |
2372 | 2377 | $manipulator = new JsonManipulator($json); |
@@ -2433,6 +2438,7 @@ public static function providerAddLinkCaseInsensitive() |
2433 | 2438 | /** |
2434 | 2439 | * @dataProvider providerAddSubNodeCase |
2435 | 2440 | */ |
| 2441 | + #[DataProvider( 'providerAddSubNodeCase' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound |
2436 | 2442 | public function testAddSubNodeCase($json, $mainNode, $name, $caseInsensitive, $expected) |
2437 | 2443 | { |
2438 | 2444 | $manipulator = new JsonManipulator($json); |
@@ -2494,6 +2500,7 @@ public static function providerAddSubNodeCase() |
2494 | 2500 | /** |
2495 | 2501 | * @dataProvider providerRemoveSubNodeCaseInsensitive |
2496 | 2502 | */ |
| 2503 | + #[DataProvider( 'providerRemoveSubNodeCaseInsensitive' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound |
2497 | 2504 | public function testRemoveSubNodeCaseInsensitive($json, $mainNode, $name, $expected, $expectedContent = null) |
2498 | 2505 | { |
2499 | 2506 | $manipulator = new JsonManipulator($json); |
|
0 commit comments