/** * @dataProvider clientCallDataProvider * @param $namespace * @param $method * @param $expectedUri */ public function testClientCalls($namespace, $method, $expectedUri) { $client = $this->createClient(); $response = m::mock('GuzzleHttp\\Message\\ResponseInterface'); $response->shouldReceive('getBody')->andReturn(TestFixtures::getFixture('accounts.getAccountInfo')); $this->guzzleClient->shouldReceive('get')->with($expectedUri, ['query' => ['apiKey' => 'key', 'secret' => 'secret', 'params' => 'passedThrough'], 'cert' => $this->certPath])->andReturn($response); $gigyaResponse = m::mock('Graze\\Gigya\\Response\\ResponseInterface'); $this->factory->shouldReceive('getResponse')->with($response)->andReturn($gigyaResponse); $result = $client->{$namespace}()->{$method}(['params' => 'passedThrough']); static::assertSame($gigyaResponse, $result); }