|
|
@@ -33,7 +33,7 @@ class RunManyTest extends TestCase
|
|
|
public $stationTaskMaterialBoxService;
|
|
|
private $data;
|
|
|
|
|
|
- private $bathAmount=3;
|
|
|
+ private $bathAmount=2;
|
|
|
function setUp(): void
|
|
|
{
|
|
|
parent::setUp();
|
|
|
@@ -61,8 +61,29 @@ class RunManyTest extends TestCase
|
|
|
$this->bathAmount)
|
|
|
->create([
|
|
|
'status'=>'未处理',
|
|
|
- 'owner_id'=>$this->data['owner']['id']
|
|
|
+ 'owner_id'=>$this->data['owner']['id'],
|
|
|
]);
|
|
|
+ $this->data['orders'] =
|
|
|
+ factory(Order::class)
|
|
|
+ ->createMany($this->makeArray($this->bathAmount, [
|
|
|
+ 'batch_id' => function () {
|
|
|
+ return $this->getTargetFieldCirculately($this->data['batches']);
|
|
|
+ }
|
|
|
+ ]));
|
|
|
+ $this->data['orderCommodities'] =
|
|
|
+ factory(OrderCommodity::class)
|
|
|
+ ->createMany($this->makeArray($this->bathAmount, [
|
|
|
+ 'order_id' => function () {
|
|
|
+ return $this->getTargetFieldCirculately($this->data['orders']);
|
|
|
+ }
|
|
|
+ ]));
|
|
|
+ $this->data['material_boxes']
|
|
|
+ = factory(MaterialBox::class)
|
|
|
+ ->createMany($this->makeArray($this->bathAmount, [
|
|
|
+ 'code' => function () {
|
|
|
+ return $this->getTargetFieldCirculately($this->data['orderCommodities'], MaterialBox::class, 'location');
|
|
|
+ }
|
|
|
+ ]));
|
|
|
$this->data['stationRuleBatch'] =
|
|
|
factory(StationRuleBatch::class)
|
|
|
-> create([
|
|
|
@@ -83,15 +104,13 @@ class RunManyTest extends TestCase
|
|
|
$this->data['stationTaskBathes']
|
|
|
);
|
|
|
$this->assertTrue($taskBatches_failed->isEmpty());
|
|
|
- $this->assertTrue((
|
|
|
- $全部是处理中状态
|
|
|
- =function(){
|
|
|
+ $this->assertTrue(($全部是处理中状态 =function(){
|
|
|
$arr=array_unique(
|
|
|
data_get($this->data['stationTaskBathes'],'*.status')
|
|
|
);
|
|
|
return
|
|
|
count($arr)==1
|
|
|
- && $arr[0]=='处理中';
|
|
|
+ && $arr[0]=='待处理';
|
|
|
})());
|
|
|
}
|
|
|
|
|
|
@@ -101,13 +120,13 @@ class RunManyTest extends TestCase
|
|
|
->whereIn('id',data_get($this->data['stationTaskBathes'],'*.id')??[])
|
|
|
->delete();
|
|
|
StationTaskMaterialBox::query()
|
|
|
- ->whereIn('id',data_get($this->data['batches'],'*.id')??[])
|
|
|
+ ->whereIn('id',data_get($this->data['stationTaskMaterialBoxes'],'*.id')??[])
|
|
|
->delete();
|
|
|
Order::query()
|
|
|
->whereIn('id',data_get($this->data['orders'],'*.id')??[])
|
|
|
->delete();
|
|
|
MaterialBox::query()
|
|
|
- ->whereIn('id',data_get($this->data['materialBoxes'],'*.id')??[])
|
|
|
+ ->whereIn('id',data_get($this->data['material_boxes'],'*.id')??[])
|
|
|
->delete();
|
|
|
OrderCommodity::query()
|
|
|
->whereIn('id',data_get($this->data['orderCommodities'],'*.id')??[])
|
|
|
@@ -119,7 +138,7 @@ class RunManyTest extends TestCase
|
|
|
StationTask::query()
|
|
|
->whereIn('id',data_get($this->data['stationTask'],'*.id')??[])
|
|
|
->delete();
|
|
|
- StationRuleBatch::query()->whereIn('id',$this->data['stationRuleBatch']['id'])->delete();
|
|
|
+ StationRuleBatch::query()->where('id',$this->data['stationRuleBatch']['id'])->delete();
|
|
|
Batch::query()->whereIn('id',data_get($this->data['batches'],'*.id'))->delete();
|
|
|
Owner::query()->where('id',$this->data['owner']['id'])->delete();
|
|
|
parent::tearDown();
|