src/Request/Adapter/CurlMock.php
protected function createResponse($statusCode, $contentType)
    {
        switch ($statusCode) {
            case 200:
            case 201:
                return $this->createContent($contentType);
            default:
                // fail on error
                if ($this->curlOptions[45]) {
                    throw new LushRequestException($this, ['message' => sprintf('%d - Mocked server error', $statusCode), 'code' => $statusCode, 'response' => 'false']);
                }

                return json_encode(['url' => $this->ch, 'status' => sprintf('Error: %d', $statusCode)]);
        }
    }
protected function createResponse($statusCode, $contentType)
    {
        switch ($statusCode) {
            case 200:
            case 201:
                return $this->createContent($contentType);
            default:
                // fail on error
                if ($this->curlOptions[45]) {
                    throw new LushRequestException($this, ['message' => sprintf('%d - Mocked server error', $statusCode), 'code' => $statusCode, 'response' => 'false']);
                }

                return json_encode(['url' => $this->ch, 'status' => sprintf('Error: %d', $statusCode)]);
        }
    }
protected function createResponse ( $ statusCode , $ contentType ) { switch ( $ statusCode ) { case 200 : case 201 : return $ this -> createContent ( $ contentType ) ; default : // fail on error if ( $ this -> curlOptions [ 45 ] ) { throw new LushRequestException ( $ this , [ 'message' => sprintf ( '%d - Mocked server error' , $ statusCode ) , 'code' => $ statusCode , 'response' => 'false' ] ) ; } return json_encode ( [ 'url' => $ this -> ch , 'status' => sprintf ( 'Error: %d' , $ statusCode ) ] ) ; } }
Create a example response based on statuscode.

@param $statusCode
@param $contentType

@return string
Create a example response based on statuscode .