1414use Art4 \JsonApiClient \Manager \ErrorAbortManager ;
1515use Art4 \JsonApiClient \Tests \Fixtures \HelperTrait ;
1616use Art4 \JsonApiClient \V1 \Factory ;
17+ use PHPUnit \Framework \Attributes \DataProvider ;
1718use PHPUnit \Framework \TestCase ;
1819
1920class ParsingTest extends TestCase
@@ -38,9 +39,7 @@ public static function createParserProvider(): array
3839 ];
3940 }
4041
41- /**
42- * @dataProvider createParserProvider
43- */
42+ #[DataProvider('createParserProvider ' )]
4443 public function testParseSimpleResourceWithDifferentParser (callable $ parser ): void
4544 {
4645 $ string = $ this ->getJsonString ('01_simple_resource.json ' );
@@ -67,9 +66,6 @@ public function testParseSimpleResourceWithDifferentParser(callable $parser): vo
6766 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\RelationshipCollection ' , $ resource ->get ('relationships ' ));
6867 }
6968
70- /**
71- * @test
72- */
7369 public function testParseSimpleResourceIdentifier (): void
7470 {
7571 $ string = $ this ->getJsonString ('02_simple_resource_identifier.json ' );
@@ -91,9 +87,6 @@ public function testParseSimpleResourceIdentifier(): void
9187 $ this ->assertSame ($ resource ->get ('id ' ), '1 ' );
9288 }
9389
94- /**
95- * @test
96- */
9790 public function testParseResourceObject (): void
9891 {
9992 $ string = $ this ->getJsonString ('03_resource_object.json ' );
@@ -159,9 +152,6 @@ public function testParseResourceObject(): void
159152 $ this ->assertSame ($ data ->get ('id ' ), '9 ' );
160153 }
161154
162- /**
163- * @test
164- */
165155 public function testParseCompleteResourceObjectWithMultipleRelationships (): void
166156 {
167157 $ string = $ this ->getJsonString ('04_complete_document_with_multiple_relationships.json ' );
@@ -355,9 +345,6 @@ public function testParseCompleteResourceObjectWithMultipleRelationships(): void
355345 $ this ->assertSame ($ links ->get ('self ' ), 'http://example.com/comments/12 ' );
356346 }
357347
358- /**
359- * @test
360- */
361348 public function testParsePaginationExample (): void
362349 {
363350 $ string = $ this ->getJsonString ('06_pagination_example.json ' );
@@ -409,9 +396,6 @@ public function testParsePaginationExample(): void
409396 $ this ->assertSame ($ links ->get ('last ' ), 'http://example.com/articles?page[number]=13&page[size]=1 ' );
410397 }
411398
412- /**
413- * @test
414- */
415399 public function testParseRelationshipExample (): void
416400 {
417401 $ string = $ this ->getJsonString ('07_relationship_example_without_data.json ' );
@@ -475,9 +459,6 @@ public function testParseRelationshipExample(): void
475459 $ this ->assertSame ($ document ->get ('data.0.relationships.comments.links.related.meta.count ' ), 10 );
476460 }
477461
478- /**
479- * @test
480- */
481462 public function testParseObjectLinksExample (): void
482463 {
483464 $ string = $ this ->getJsonString ('08_object_links.json ' );
@@ -518,9 +499,6 @@ public function testParseObjectLinksExample(): void
518499 $ this ->assertSame ('bar ' , $ document ->get ('jsonapi.meta.foo ' ));
519500 }
520501
521- /**
522- * @test
523- */
524502 public function testParseResourceIdentifierWithMeta (): void
525503 {
526504 $ string = $ this ->getJsonString ('11_resource_identifier_with_meta.json ' );
@@ -544,9 +522,6 @@ public function testParseResourceIdentifierWithMeta(): void
544522 $ this ->assertSame ($ resource ->get ('id ' ), '2 ' );
545523 }
546524
547- /**
548- * @test
549- */
550525 public function testParseNullResource (): void
551526 {
552527 $ string = $ this ->getJsonString ('12_null_resource.json ' );
@@ -565,9 +540,6 @@ public function testParseNullResource(): void
565540 $ this ->assertInstanceOf ('Art4\JsonApiClient\V1\ResourceNull ' , $ resource );
566541 }
567542
568- /**
569- * @test
570- */
571543 public function testParseResourceIdentifierCollectionWithMeta (): void
572544 {
573545 $ string = $ this ->getJsonString ('13_collection_with_resource_identifier_with_meta.json ' );
@@ -602,9 +574,6 @@ public function testParseResourceIdentifierCollectionWithMeta(): void
602574 $ this ->assertSame ($ resource1 ->get ('id ' ), '2 ' );
603575 }
604576
605- /**
606- * @test
607- */
608577 public function testParseCreateResourceWithoutId (): void
609578 {
610579 $ string = $ this ->getJsonString ('14_create_resource_without_id.json ' );
@@ -614,9 +583,6 @@ public function testParseCreateResourceWithoutId(): void
614583 $ this ->assertSame (['data ' ], $ document ->getKeys ());
615584 }
616585
617- /**
618- * @test
619- */
620586 public function testParseCreateShortResourceWithoutId (): void
621587 {
622588 $ string = $ this ->getJsonString ('15_create_resource_without_id.json ' );
@@ -626,19 +592,13 @@ public function testParseCreateShortResourceWithoutId(): void
626592 $ this ->assertSame (['data ' ], $ document ->getKeys ());
627593 }
628594
629- /**
630- * @test
631- */
632595 public function testExceptionIfIdIsNotString (): void
633596 {
634597 $ this ->expectException (\Art4 \JsonApiClient \Exception \ValidationException::class);
635598 $ string = $ this ->getJsonString ('16_type_and_id_as_integer.json ' );
636599 $ document = Parser::parseResponseString ($ string );
637600 }
638601
639- /**
640- * @test
641- */
642602 public function testParseLinksInRelationshipsCorrectly (): void
643603 {
644604 $ string = $ this ->getJsonString ('17_relationship_links.json ' );
0 commit comments