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 = []; $nav_count = random_int(5, 20); $navpoints = factory(App\Models\Navdata::class, $nav_count)->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($nav_count, $coords); } }