GetParamByOrderHeaderTest.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace Tests\Services\OrderService\GetParamByOrderHeaderTest;
  3. use App\OracleDOCOrderHeader;
  4. use App\Services\LogisticService;
  5. use App\Services\OrderIssueService;
  6. use App\Services\OrderService;
  7. use App\Services\OwnerService;
  8. use App\Services\ShopService;
  9. use App\Services\WarehouseService;
  10. use Illuminate\Foundation\Testing\RefreshDatabase;
  11. use Illuminate\Foundation\Testing\WithFaker;
  12. use Tests\TestCase;
  13. class GetParamByOrderHeaderTest extends TestCase
  14. {
  15. use RefreshDatabase;
  16. /** @var OrderService $service */
  17. public $service;
  18. public function setUp(): void
  19. {
  20. parent::setUp();
  21. $this->service = app(OrderService::class);
  22. }
  23. /**
  24. * @test
  25. */
  26. public function testGetParamByOrderHeader()
  27. {
  28. $orderHeader = OracleDOCOrderHeader::query()->where('sostatus',99)->orderByDesc('addtime')->first();
  29. $orderHeaders = OracleDOCOrderHeader::query()
  30. ->where('sostatus',99)
  31. ->where('addtime','>=',$orderHeader->addtime)
  32. ->get();
  33. app(ShopService::class)->getByWmsOrders($orderHeaders);
  34. app(OwnerService::class)->getByWmsOrders($orderHeaders);
  35. app(LogisticService::class)->getByWmsOrders($orderHeaders);
  36. app(WarehouseService::class)->getByWmsOrders($orderHeaders);
  37. $param = $this->service->getParamByOrderHeader($orderHeader);
  38. $this->assertNotNull($param);
  39. $this->assertNotEmpty($param['code']);
  40. $this->assertNotEmpty($param['owner_id']);
  41. $this->assertNotNull($param['logistic_id']);
  42. $this->assertNotEmpty($param['consignee_name']);
  43. $this->assertNotEmpty($param['consignee_phone']);
  44. $this->assertNotEmpty($param['province']);
  45. $this->assertNotEmpty($param['city']);
  46. $this->assertNotEmpty($param['district']);
  47. $this->assertNotEmpty($param['address']);
  48. $this->assertNotEmpty($param['client_code']);
  49. $this->assertNotEmpty($param['wms_edittime']);
  50. $this->assertNotEmpty($param['wms_status']);
  51. $this->assertNotEmpty($param['updated_at']);
  52. $this->assertNotEmpty($param['created_at']);
  53. $this->assertNotEmpty($param['warehouse_id']);
  54. }
  55. }