示例#1
0
 /**
  * @expectedException GuzzleHttp\Exception\BadResponseException
  *
  * testClientException.
  */
 public function testClientExceptionWithStatusCode()
 {
     $mock = new MockHandler([new Response(200), new Response(404, ['Content-Type' => 'application/json'])]);
     $handler = HandlerStack::create($mock);
     $client = new Client(['handler' => $handler, 'username' => 'admin', 'password' => 'admin']);
     $client->get('/');
 }