service = app('OrderPackageService'); $this->orderService = app('OrderService'); $this->orderHeaderService = app('OracleDOCOrderHeaderService'); } public function testGetInnerParamsTest() { $orderHeader = OracleDOCOrderHeader::query()->with('actAllocationDetails')->orderByDesc('AddTime')->first(); $order = Order::query()->where('code',$orderHeader->orderno)->first(); $inner_params = $this->service->getInnerParams($orderHeader,$order,[]); $this->assertNotEmpty($inner_params); $actAllocationDetails = $orderHeader->actAllocationDetails; foreach ($inner_params as $inner_param) { $detail = $actAllocationDetails->where('picktotraceid',$inner_param['logistic_number'])->first(); $this->assertNotEmpty($detail); $this->assertEquals($inner_param['order_id'],$order->id); $this->assertEquals($inner_param['logistic_number'],$detail->picktotraceid); $this->assertNotEmpty($inner_param['created_at']); $this->assertNotEmpty($inner_param['updated_at']); } } }