Ejemplo n.º 1
0
 public function testRequest()
 {
     $client = \Mockery::mock(Client::class, ['get' => new Response(200, [], '{"foo":"bar"}'), 'post' => new Response(200, [], '{"foo":"bar"}'), 'delete' => new Response(200, [], '{"foo":"bar"}'), 'put' => new Response(200, [], '{"foo":"bar"}')]);
     $api = new RESTfulService('foo', null, 'http://foo.com', $client);
     $this->assertObjectHasAttribute('foo', $api->get('/'));
     $this->assertObjectHasAttribute('foo', $api->post('/'));
     $this->assertObjectHasAttribute('foo', $api->put('/'));
     $this->assertObjectHasAttribute('foo', $api->delete('/'));
 }