/** * @dataProvider methodProvider */ public function testCallBasicMethods($method) { $options = []; $request = new Request('GET', '/somewhere'); $response = new Response(200, [], $this->successBody); $requestBuilder = $this->prophesize('Google\\Cloud\\RequestBuilder'); $requestBuilder->build(Argument::type('string'), Argument::type('string'), Argument::type('array'))->willReturn($request); $this->requestWrapper->send(Argument::type('Psr\\Http\\Message\\RequestInterface'), Argument::type('array'))->willReturn($response); $rest = new Rest(); $rest->setRequestBuilder($requestBuilder->reveal()); $rest->setRequestWrapper($this->requestWrapper->reveal()); $this->assertEquals(json_decode($this->successBody, true), $rest->{$method}($options)); }