1212
1313use WP_CLI \JsonManipulator ; // WP_CLI
1414use WP_CLI \Tests \TestCase ;
15+ use PHPUnit \Framework \Attributes \DataProvider ;
1516
1617class 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