public function testCallCreatesResponse() { $testOpts = array(); $this->mockClient->shouldReceive('get')->with('/data/2.5/weather', $testOpts)->once()->andReturn($this->getMockResponseInterface()); $response = $this->requester->call($testOpts); $this->assertInstanceOf('JCrowe\\OpenWeather\\Response', $response); }
/** * Get weather report for the provided $city name * * @param $city * @param string $country * @param string $unit * @return Response * @throws RequestException */ public function getByCityName($city, $country = 'us', $unit = 'imperial') { $params = array('q' => $city . ',' . $country, 'units' => $unit); return $this->requester->makeRequest($params); }