Skip to content

Commit ea12636

Browse files
committed
Add spec for JSON:API 1.1, run tests with normative statements
1 parent 05c2e91 commit ea12636

File tree

5 files changed

+5003
-0
lines changed

5 files changed

+5003
-0
lines changed

tests/Functional/ParsingTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,4 +659,16 @@ public function testParseNormativeStatementsForVersion10Correctly(): void
659659
$this->assertCount(6, $document->get('data')->getKeys());
660660
$this->assertCount(184, $document->get('included')->getKeys());
661661
}
662+
663+
public function testParseNormativeStatementsForVersion11Correctly(): void
664+
{
665+
$string = $this->getJsonString('format_1.1/normative-statements.json');
666+
$document = Parser::parseResponseString($string);
667+
668+
$this->assertInstanceOf('Art4\JsonApiClient\V1\Document', $document);
669+
$this->assertSame(['data', 'included', 'jsonapi'], $document->getKeys());
670+
$this->assertSame('1.1', $document->get('jsonapi.version'));
671+
$this->assertCount(6, $document->get('data')->getKeys());
672+
$this->assertCount(188, $document->get('included')->getKeys());
673+
}
662674
}

tests/files/format_1.0/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# JSON:API spec version 1.0
22

33
Source: https://github.com/json-api/json-api/tree/v1.1/_format/1.0
4+
5+
The file `normative-statements.json` has been modified to contain only valid JSON.

tests/files/format_1.1/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# JSON:API spec version 1.1
2+
3+
Source: https://github.com/json-api/json-api/tree/v1.1/_format/1.1
4+
5+
The file `normative-statements.json` has been modified to contain only valid JSON.

0 commit comments

Comments
 (0)