Set IDs to unique ints so tests don't occasionally fail

This commit is contained in:
Nabeel Shahzad 2018-05-21 12:23:26 -05:00
parent 17cece598b
commit 019cf9b4fb
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ use Faker\Generator as Faker;
$factory->define(App\Models\Flight::class, function (Faker $faker) { $factory->define(App\Models\Flight::class, function (Faker $faker) {
return [ return [
'id' => null, 'id' => $faker->unique()->numberBetween(10, 10000000),
'airline_id' => function () { 'airline_id' => function () {
return factory(App\Models\Airline::class)->create()->id; return factory(App\Models\Airline::class)->create()->id;
}, },

View File

@ -8,7 +8,7 @@ use Faker\Generator as Faker;
*/ */
$factory->define(App\Models\Pirep::class, function (Faker $faker) { $factory->define(App\Models\Pirep::class, function (Faker $faker) {
return [ return [
'id' => null, 'id' => $faker->unique()->numberBetween(10, 10000000),
'airline_id' => function () { 'airline_id' => function () {
return factory(App\Models\Airline::class)->create()->id; return factory(App\Models\Airline::class)->create()->id;
}, },