/** * @expectedException \Chatwork\Exception\UnauthorizedException */ public function testExecuteWhenHTTPFailed() { $fixture = $this->loadFixture("errors.json"); $decoded_fixture = json_decode($fixture, true); $client = new \Chatwork\API\Client(); $strategy = new \Chatwork\Strategy\API\V1Strategy(array("driver" => $this->getMockDriver(array(array("HTTP_CODE" => 401, "Content-Type" => "application/json"), $fixture)))); $client->setStrategy($strategy); $result = $client->getRoomMessage(123); }