/** * @test * @dataProvider dataMethods */ public function dataMethodsSendsProperRequestWithData($method, $expectedMethod) { $this->request->shouldReceive($expectedMethod)->with('http://test.example.com/foo/bar', '{"test":"boo"}')->andReturnSelf(); $this->request->shouldReceive('send')->andReturn((object) ['body' => 'OK']); $actual = $this->client->callRestfulApi($method, 'foo/bar', json_encode(['test' => 'boo'])); $this->assertEquals('OK', $actual); }
public function register($serviceName, $config) { return $this->client->callRestfulApi('PUT', "api/services/{$serviceName}/provider", $config); }