/** * @param string $method * @param string $host * @param string $path * @param array $parameters * * @return array|object */ private function http($method, $host, $path, array $parameters) { $this->resetLastResponse(); $url = sprintf('%s/%s/%s', $host, static::API_VERSION, $path); $this->response->setApiPath($path); $result = $this->oAuthRequest($url, $method, $parameters); $response = JsonDecoder::decode($result, $this->decodeJsonAsArray); $this->response->setBody($response); return $response; }
/** * @dataProvider jsonProvider */ public function testDecode($input, $asArray, $expected) { $this->assertEquals($expected, JsonDecoder::decode($input, $asArray)); }