->
method('getInfo'
) ->
willReturnMap([ ['http_code', 400
],
['url', 'http://example.com'
],
['response_headers',
[ 'HTTP/1.1 400 Bad Request',
'Content-Type: '.
$mimeType,
]],
]);
$response->
method('getContent'
)->
willReturn($json);
$e =
new TestException($response);
$this->
assertSame(400,
$e->
getCode());
$this->
assertSame($expectedMessage,
$e->
getMessage());
}}class TestException extends \Exception
{ use HttpExceptionTrait;
}