/** * @test */ public function shouldReturnUntouchedResponse() { $mock = new MockHandler([new Response(200, [], $this->fauxSmugMugResponse)]); $handler = HandlerStack::create($mock); $client = new Client($this->APIKey, ['handler' => $handler]); $client->get('user/' . $this->user); $decoded_response = json_decode((string) $client->getResponse()->getBody()); $this->assertNotNull($decoded_response->Response); $this->assertNotNull($decoded_response->Options); $this->assertEquals('bar', $decoded_response->Response->ano); $this->assertEquals('bar', $decoded_response->Options->foo); $this->assertEquals(200, $decoded_response->Code); $this->assertEquals('OK', $decoded_response->Message); }