Example #1
0
 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);
 }
Example #2
0
 /**
  * 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);
 }