function it_receives_null_when_the_api_returns_404(){

        //---------------------------------
        // Test Setup

        $code = 404;

        $this->httpClient->sendRequest( Argument::type('Psr\Http\Message\RequestInterface') )->willReturn(
            new Response(
                $code,
                ['Content-type'  => 'application/json']
            )
        );

        //---------------------------------
        // Perform action

        $response = $this->getNotification( '35836a9e-5a97-4d99-8309-0c5a2c3dbc72' );

        //---------------------------------
        // Check result

        $response->shouldBeNull();

    }
function it_receives_null_when_the_api_returns_404(){

        //---------------------------------
        // Test Setup

        $code = 404;

        $this->httpClient->sendRequest( Argument::type('Psr\Http\Message\RequestInterface') )->willReturn(
            new Response(
                $code,
                ['Content-type'  => 'application/json']
            )
        );

        //---------------------------------
        // Perform action

        $response = $this->getNotification( '35836a9e-5a97-4d99-8309-0c5a2c3dbc72' );

        //---------------------------------
        // Check result

        $response->shouldBeNull();

    }
function it_receives_null_when_the_api_returns_404 ( ) { //--------------------------------- // Test Setup $ code = 404 ; $ this -> httpClient -> sendRequest ( Argument :: type ( 'Psr\Http\Message\RequestInterface' ) ) -> willReturn ( new Response ( $ code , [ 'Content-type' => 'application/json' ] ) ) ; //--------------------------------- // Perform action $ response = $ this -> getNotification ( '35836a9e-5a97-4d99-8309-0c5a2c3dbc72' ) ; //--------------------------------- // Check result $ response -> shouldBeNull ( ) ; }
Actions with expected errors
Actions with expected errors