|
@@ 44-57 (lines=14) @@
|
| 41 |
|
* Api to Weather station, json response |
| 42 |
|
* @return void |
| 43 |
|
*/ |
| 44 |
|
public function testProxyWithParams() |
| 45 |
|
{ |
| 46 |
|
$client = static::createClient(); |
| 47 |
|
|
| 48 |
|
// Lets get graviton version, core is or endpoint in test config for weather api |
| 49 |
|
$client->request('GET', '/proxy/weather/weather?q=London,uk'); |
| 50 |
|
$content = $client->getResponse()->getContent(); |
| 51 |
|
$weather = json_decode($content, true); |
| 52 |
|
|
| 53 |
|
$this->assertArrayHasKey('coord', $weather, ''); |
| 54 |
|
$this->assertArrayHasKey('weather', $weather, ''); |
| 55 |
|
$this->assertArrayHasKey('name', $weather, ''); |
| 56 |
|
$this->assertEquals('London', $weather['name'], ''); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
/** |
| 60 |
|
* Testing basic functionality |
|
@@ 64-77 (lines=14) @@
|
| 61 |
|
* Api to Weather station, limit query params and convert |
| 62 |
|
* @return void |
| 63 |
|
*/ |
| 64 |
|
public function testProxyQueryParamsLimit() |
| 65 |
|
{ |
| 66 |
|
$client = static::createClient(); |
| 67 |
|
|
| 68 |
|
// Lets get graviton version, core is or endpoint in test config for weather api |
| 69 |
|
$client->request('GET', '/proxy/weather-by-city?city=London&country=uk'); |
| 70 |
|
$content = $client->getResponse()->getContent(); |
| 71 |
|
$weather = json_decode($content, true); |
| 72 |
|
|
| 73 |
|
$this->assertArrayHasKey('coord', $weather, ''); |
| 74 |
|
$this->assertArrayHasKey('weather', $weather, ''); |
| 75 |
|
$this->assertArrayHasKey('name', $weather, ''); |
| 76 |
|
$this->assertEquals('London', $weather['name'], ''); |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
/** |
| 80 |
|
* Testing basic functionality |