From 0b9654cf613c3222387201c927bb2dc00761f314 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Sun, 21 Jan 2018 13:51:42 -0500 Subject: [PATCH] Reduce the amount of test data produced to prevent data generation errors --- tests/AcarsTest.php | 2 +- tests/FlightTest.php | 8 ++++---- tests/GeoTest.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/AcarsTest.php b/tests/AcarsTest.php index c5911f5c..e5b8ca58 100644 --- a/tests/AcarsTest.php +++ b/tests/AcarsTest.php @@ -140,7 +140,7 @@ class AcarsTest extends TestCase $uri = '/api/pireps/' . $pirep_id . '/acars/position'; # Post an ACARS update - $acars_count = \random_int(5, 50); + $acars_count = \random_int(2, 10); $acars = factory(App\Models\Acars::class, $acars_count)->make(['id'=>''])->toArray(); $update = ['positions' => $acars]; diff --git a/tests/FlightTest.php b/tests/FlightTest.php index 20a03e50..497700dd 100644 --- a/tests/FlightTest.php +++ b/tests/FlightTest.php @@ -59,19 +59,19 @@ class FlightTest extends TestCase */ public function testFindAllFlights() { - factory(App\Models\Flight::class, 120)->create(); + factory(App\Models\Flight::class, 70)->create(); $res = $this->get('/api/flights'); $body = $res->json(); - $this->assertEquals(3, $body['meta']['last_page']); + $this->assertEquals(2, $body['meta']['last_page']); - $res = $this->get('/api/flights?page=3'); + $res = $this->get('/api/flights?page=2'); $res->assertJsonCount(20, 'data'); } public function testFlightSearchApi() { - $flights = factory(App\Models\Flight::class, 100)->create(); + $flights = factory(App\Models\Flight::class, 20)->create(); $flight = $flights->random(); $query = 'flight_number=' . $flight->flight_number; diff --git a/tests/GeoTest.php b/tests/GeoTest.php index 906d0768..a4180226 100644 --- a/tests/GeoTest.php +++ b/tests/GeoTest.php @@ -43,7 +43,7 @@ class GeoTest extends TestCase $geoSvc = app('\App\Services\GeoService'); $route = []; - $nav_count = random_int(10, 50); + $nav_count = random_int(5, 20); $navpoints = factory(App\Models\Navdata::class, $nav_count)->create(); foreach ($navpoints as $point) { $route[] = $point->id;