randomize the number of navpoints generated in the tests

This commit is contained in:
Nabeel Shahzad
2018-01-01 19:11:49 -06:00
parent 2f36a2661a
commit 7a6395be27

View File

@@ -43,13 +43,14 @@ class GeoTest extends TestCase
$geoSvc = app('\App\Services\GeoService');
$route = [];
$navpoints = factory(App\Models\Navdata::class, 5)->create();
$nav_count = random_int(10, 50);
$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(5, $coords);
$this->assertCount($nav_count, $coords);
}
}