getClosestCoords($start_point, $potential_points); $this->assertEquals([52.15527, 22.200833], $coords); } /** * Make sure the departure airports/sid/star are all filtered out */ public function testGetCoords() { $geoSvc = app('\App\Services\GeoService'); $route = []; $navpoints = factory(App\Models\Navdata::class, 5)->create(); foreach ($navpoints as $point) { $route[] = $point->id; } $route_str = 'KAUS SID '.implode(' ', $route).' STAR KJFK'; $coords = $geoSvc->getCoordsFromRoute('KAUS', 'KJFK', [0, 0], $route_str); $this->assertCount(5, $coords); } }