Browse Source

海柔测试

LD 5 years ago
parent
commit
8aa52a82fd

+ 1 - 0
app/Traits/TestMockSubServices.php

@@ -33,4 +33,5 @@ trait TestMockSubServices{
         return $mockingService;
     }
 
+    function getTarget
 }

+ 2 - 2
tests/Services/StationTaskCommodityService/CreateByBatchTest.php

@@ -44,7 +44,7 @@ class CreateByBatchTest extends TestCase
                         }
                         $this->data['temBatchId_orders']++;
                         if($this->data['temBatchId_orders']>=$this->batchAmount)$this->data['temBatchId_orders']=0;
-                        return $this->data['batches'][$this->data['temBatchId_orders']];
+                        return $this->data['batches'][$this->data['temBatchId_orders']]['id'];
                     })(),
                 ]);
         $this->data['orderBins'] =
@@ -56,7 +56,7 @@ class CreateByBatchTest extends TestCase
                             $this->data['temOrderId_ordersBins']=-1;
                         }
                         $this->data['temOrderId_ordersBins']++;
-                        return $this->data['orders'][$this->data['temOrderId_ordersBins']];
+                        return $this->data['orders'][$this->data['temOrderId_ordersBins']]['id'];
                     })(),
                     'number'=>(function(){
                         if(!isset($this->data['temNumber_ordersBins'])){

+ 9 - 2
tests/Services/StationTaskMaterialBoxService/CreateByBatchesTest.php

@@ -37,7 +37,7 @@ class CreateByBatchesTest extends TestCase
                     return $this->data['batches'][$this->data['i_batch_id_orders']];
                 })()
             ]);
-        $this->data['stationTaskMaterialBoxes']
+        $this->data['materialBoxes']
             = factory(StationTaskMaterialBox::class, $this->materialBoxAmount)
             ->create();
         $this->data['orderCommodities']
@@ -51,7 +51,14 @@ class CreateByBatchesTest extends TestCase
                     if($this->data['i_order_id_orderCommodities']>=$this->batchAmount)$this->data['i_order_id_orderCommodities']=0;
                     return $this->data['orders'][$this->data['i_order_id_orderCommodities']];
                 })(),
-                'location'=>
+                'location'=>(function(){
+                    if(!isset($this->data['i_materialBoxes_orderCommodities'])){
+                        $this->data['i_materialBoxes_orderCommodities']=$this->batchAmount;
+                    }
+                    $this->data['i_materialBoxes_orderCommodities']++;
+                    if($this->data['i_materialBoxes_orderCommodities']>=$this->batchAmount)$this->data['i_materialBoxes_orderCommodities']=0;
+                    return $this->data['materialBoxes'][$this->data['i_materialBoxes_orderCommodities']];
+                })(),
             ]);
     }