Skip to content

Commit 544d18f

Browse files
committed
Fix unit tests
1 parent 6f5b847 commit 544d18f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/JsonManipulatorTest.php

Lines changed: 7 additions & 0 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);
@@ -2367,6 +2371,7 @@ public function testRemoveMainKeyAtEndOfFile()
23672371
/**
23682372
* @dataProvider providerAddLinkCaseInsensitive
23692373
*/
2374+
#[DataProvider( 'providerAddLinkCaseInsensitive' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
23702375
public function testAddLinkCaseInsensitive($json, $type, $package, $constraint, $sortPackages, $expected)
23712376
{
23722377
$manipulator = new JsonManipulator($json);
@@ -2433,6 +2438,7 @@ public static function providerAddLinkCaseInsensitive()
24332438
/**
24342439
* @dataProvider providerAddSubNodeCase
24352440
*/
2441+
#[DataProvider( 'providerAddSubNodeCase' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
24362442
public function testAddSubNodeCase($json, $mainNode, $name, $caseInsensitive, $expected)
24372443
{
24382444
$manipulator = new JsonManipulator($json);
@@ -2494,6 +2500,7 @@ public static function providerAddSubNodeCase()
24942500
/**
24952501
* @dataProvider providerRemoveSubNodeCaseInsensitive
24962502
*/
2503+
#[DataProvider( 'providerRemoveSubNodeCaseInsensitive' )] // phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPUnitAttributeFound
24972504
public function testRemoveSubNodeCaseInsensitive($json, $mainNode, $name, $expected, $expectedContent = null)
24982505
{
24992506
$manipulator = new JsonManipulator($json);

0 commit comments

Comments
 (0)