Add tests for 0 results METAR
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
|
9
tests/data/aviationweather/no_results.xml
Normal file
9
tests/data/aviationweather/no_results.xml
Normal file
@ -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…
Reference in New Issue
Block a user