/** * @expectedException Tufesa\Service\Exceptions\ResponseException */ public function test_problem_with_tufesa_get_schedules_should_raise_an_exception() { $response = new \Guzzle\Http\Message\Response(200); $response->setBody('{"_id": "1.0", "_Response": { "_revAuth": null, "resultField": { "_id": "666", "_message": "SOME DUMMY MESSAGE HERE" } } }'); $plugin = new \Guzzle\Plugin\Mock\MockPlugin(); $plugin->addResponse($response); $guzzleClient = new GuzzleClient(); $guzzleClient->addSubscriber($plugin); $tufesaClient = new Client($guzzleClient); $from = "GDL"; $to = "OBR"; $date = new \DateTime("tomorrow"); $schedules = $tufesaClient->getSchedules($from, $to, $date); }