Add tests for 0 results METAR

pull/1141/head
Nabeel Shahzad 3 years ago
parent f5e83461a3
commit d18925f473

@ -247,4 +247,15 @@ class MetarTest extends TestCase
$metar = $airportSvc->getMetar('7AK4');
$this->assertNull($metar);
}
public function testHttpCallNoResults()
{
$this->mockXmlResponse('aviationweather/no_results.xml');
/** @var AirportService $airportSvc */
$airportSvc = app(AirportService::class);
$metar = $airportSvc->getMetar('AYMR');
$this->assertNull($metar);
}
}

@ -0,0 +1,9 @@
<response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:noNamespaceSchemaLocation="http://www.aviationweather.gov/static/adds/schema/metar1_2.xsd">
<request_index>414399629</request_index>
<data_source name="metars"/>
<request type="retrieve"/>
<errors/>
<warnings/>
<time_taken_ms>5</time_taken_ms>
<data num_results="0"/>
</response>
Loading…
Cancel
Save