From d18925f4732dd616cf6a1dda4b073cf6d72168fa Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Wed, 14 Apr 2021 06:45:35 -0400 Subject: [PATCH] Add tests for 0 results METAR --- tests/MetarTest.php | 11 +++++++++++ tests/data/aviationweather/no_results.xml | 9 +++++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/data/aviationweather/no_results.xml diff --git a/tests/MetarTest.php b/tests/MetarTest.php index a4c22fc2..32db911b 100644 --- a/tests/MetarTest.php +++ b/tests/MetarTest.php @@ -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); + } } diff --git a/tests/data/aviationweather/no_results.xml b/tests/data/aviationweather/no_results.xml new file mode 100644 index 00000000..fff51045 --- /dev/null +++ b/tests/data/aviationweather/no_results.xml @@ -0,0 +1,9 @@ + +414399629 + + + + +5 + +