LD 5 vuotta sitten
vanhempi
commit
fb5fcd4890

+ 1 - 1
database/factories/StationTypeFactory.php

@@ -7,6 +7,6 @@ use Faker\Generator as Faker;
 
 $factory->define(StationType::class, function (Faker $faker) {
     return [
-        //
+        'name'=>$faker->name
     ];
 });

+ 8 - 1
tests/Services/StationTaskBatchService/CreateByBatchesTest.php

@@ -9,6 +9,7 @@ use App\Services\StationTaskService;
 use App\StationRuleBatch;
 use App\StationTask;
 use App\StationTaskBatch;
+use App\StationType;
 use Tests\TestCase;
 
 class CreateByBatchesTest extends TestCase
@@ -31,7 +32,13 @@ class CreateByBatchesTest extends TestCase
         $this->data['batches'] =
             factory(Batch::class,
                 self::AmountOfBatch)
-                ->create();
+                ->create([
+                    'status'=>'未处理',
+                    'owner_id'=>$this->data['owner']['id']
+                ]);
+        $this->data['stationType'] =
+            factory(StationType::class)
+                -> create();
         $this->data['stationRuleBatch'] =
             factory(StationRuleBatch::class)
                 -> create([