tests/Extensions/Issue169/IssueTest.php
/**
     * Test encoder will serialize into arrays.
     *
     * @see https://github.com/neomerx/json-api/issues/169
     */
Test encoder will serialize into arrays.
Test encoder will serialize into arrays .
public function testErrorSerialization(): void
    {
        $error = new Error('some-id');
        $encoder = CustomEncoder::instance();
        $this->assertEquals(['errors' => [['id' => 'some-id']]], $encoder->serializeError($error));
        $this->assertEquals(['errors' => [['id' => 'some-id']]], $encoder->serializeErrors([$error]));
    }
public function testErrorSerialization ( ) : void { $ error = new Error ( 'some-id' ) ; $ encoder = CustomEncoder :: instance ( ) ; $ this -> assertEquals ( [ 'errors' => [ [ 'id' => 'some-id' ] ] ] , $ encoder -> serializeError ( $ error ) ) ; $ this -> assertEquals ( [ 'errors' => [ [ 'id' => 'some-id' ] ] ] , $ encoder -> serializeErrors ( [ $ error ] ) ) ; }
Test encoder will serialize into arrays.
Test encoder will serialize into arrays .
/** @var CustomEncoder $encoder */