tests/Http/ResponsesTest.php
/**
     * Test response, with custom headers.
     */
Test response, with custom headers.
Test response with custom headers .
public function testErrorResponse4(): void
    {
        $error = new Error();
        $this->willBeCalledGetMediaType('some', 'type');
        $this->willBeCalledEncoderForError($error, 'some json api');
        $headers = [BaseResponses::HEADER_CONTENT_TYPE => 'some/type', 'X-Custom' => 'Custom-Header'];
        $this->willBeCalledCreateResponse('some json api', 321, $headers, 'some response');
        self::assertEquals(
            'some response',
            $this->responses->getErrorResponse(
                $error,
                321,
                [
                    'X-Custom' => 'Custom-Header',
                ]
            )
        );
    }
public function testErrorResponse4 ( ) : void { $ error = new Error ( ) ; $ this -> willBeCalledGetMediaType ( 'some' , 'type' ) ; $ this -> willBeCalledEncoderForError ( $ error , 'some json api' ) ; $ headers = [ BaseResponses :: HEADER_CONTENT_TYPE => 'some/type' , 'X-Custom' => 'Custom-Header' ] ; $ this -> willBeCalledCreateResponse ( 'some json api' , 321 , $ headers , 'some response' ) ; self :: assertEquals ( 'some response' , $ this -> responses -> getErrorResponse ( $ error , 321 , [ 'X-Custom' => 'Custom-Header' , ] ) ) ; }
Test response, with custom headers.
Test response with custom headers .