| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- namespace Tests\Services\OrderService\GetParamByOrderHeaderTest;
- use App\OracleDOCOrderHeader;
- use App\Services\LogisticService;
- use App\Services\OrderIssueService;
- use App\Services\OrderService;
- use App\Services\OwnerService;
- use App\Services\ShopService;
- use App\Services\WarehouseService;
- use Illuminate\Foundation\Testing\RefreshDatabase;
- use Illuminate\Foundation\Testing\WithFaker;
- use Tests\TestCase;
- class GetParamByOrderHeaderTest extends TestCase
- {
- use RefreshDatabase;
- /** @var OrderService $service */
- public $service;
- public function setUp(): void
- {
- parent::setUp();
- $this->service = app(OrderService::class);
- }
- /**
- * @test
- */
- public function testGetParamByOrderHeader()
- {
- $orderHeader = OracleDOCOrderHeader::query()->where('sostatus',99)->orderByDesc('addtime')->first();
- $orderHeaders = OracleDOCOrderHeader::query()
- ->where('sostatus',99)
- ->where('addtime','>=',$orderHeader->addtime)
- ->get();
- app(ShopService::class)->getByWmsOrders($orderHeaders);
- app(OwnerService::class)->getByWmsOrders($orderHeaders);
- app(LogisticService::class)->getByWmsOrders($orderHeaders);
- app(WarehouseService::class)->getByWmsOrders($orderHeaders);
- $param = $this->service->getParamByOrderHeader($orderHeader);
- $this->assertNotNull($param);
- $this->assertNotEmpty($param['code']);
- $this->assertNotEmpty($param['owner_id']);
- $this->assertNotNull($param['logistic_id']);
- $this->assertNotEmpty($param['consignee_name']);
- $this->assertNotEmpty($param['consignee_phone']);
- $this->assertNotEmpty($param['province']);
- $this->assertNotEmpty($param['city']);
- $this->assertNotEmpty($param['district']);
- $this->assertNotEmpty($param['address']);
- $this->assertNotEmpty($param['client_code']);
- $this->assertNotEmpty($param['wms_edittime']);
- $this->assertNotEmpty($param['wms_status']);
- $this->assertNotEmpty($param['updated_at']);
- $this->assertNotEmpty($param['created_at']);
- $this->assertNotEmpty($param['warehouse_id']);
- }
- }
|