tests/Encoder/EncodeSimpleObjectsTest.php
/**
     * Test encoding with JSON API version.
     */
Test encoding with JSON API version.
Test encoding with JSON API version .
public function testEncodeJsonApiVersion(): void
    {
        $actual = Encoder::instance()
            ->withJsonApiVersion(Encoder::JSON_API_VERSION)->withJsonApiMeta(['some' => 'meta'])
            ->encodeData(null);
        $expected = <<<EOL
        {
            "jsonapi" : {
                "version" : "1.1",
                "meta"    : { "some" : "meta" }
            },
            "data" : null
        }
EOL;
        self::assertJsonStringEqualsJsonString($expected, $actual);
    }
public function testEncodeJsonApiVersion ( ) : void { $ actual = Encoder :: instance ( ) -> withJsonApiVersion ( Encoder :: JSON_API_VERSION ) -> withJsonApiMeta ( [ 'some' => 'meta' ] ) -> encodeData ( null ) ; $ expected = <<< EOL         {             "jsonapi" : {                 "version" : "1.1",                 "meta"    : { "some" : "meta" }             },             "data" : null         } 
EOL ; self :: assertJsonStringEqualsJsonString ( $ expected , $ actual ) ; }
Test encoding with JSON API version.
Test encoding with JSON API version .