| @@ 30-39 (lines=10) @@ | ||
| 27 | */ |
|
| 28 | protected $owm; |
|
| 29 | ||
| 30 | protected function setUp() |
|
| 31 | { |
|
| 32 | // Load the app configuration |
|
| 33 | $ini = parse_ini_file(__DIR__ . '/ApiKey.ini'); |
|
| 34 | $apiKey = $ini['api_key']; |
|
| 35 | ||
| 36 | $this->owm = new OpenWeatherMap(); |
|
| 37 | $this->owm->setApiKey($apiKey); |
|
| 38 | } |
|
| 39 | ||
| 40 | public function testByCity() |
|
| 41 | { |
|
| 42 | // Default units (imperial) and language (English) |
|
| @@ 30-39 (lines=10) @@ | ||
| 27 | */ |
|
| 28 | protected $owm; |
|
| 29 | ||
| 30 | protected function setUp() |
|
| 31 | { |
|
| 32 | $ini = parse_ini_file(__DIR__ . '/ApiKey.ini'); |
|
| 33 | $apiKey = $ini['api_key']; |
|
| 34 | ||
| 35 | $this->owm = new OpenWeatherMap(); |
|
| 36 | $this->owm->setApiKey($apiKey); |
|
| 37 | } |
|
| 38 | ||
| 39 | public function testTemperatureMetric() |
|
| 40 | { |
|
| 41 | $forecast = $this->owm->getWeatherForecast('Berlin', 'metric', 'de', '', 10); |
|
| 42 | ||