TempMarkBinProcessedTest.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?php
  2. namespace Tests\Services\ForeignHaiRoboticsService;
  3. use App\Batch;
  4. use App\MaterialBox;
  5. use App\Order;
  6. use App\OrderCommodity;
  7. use App\Services\BatchService;
  8. use App\Services\ForeignHaiRoboticsService;
  9. use App\Services\StationService;
  10. use App\Services\StationTaskBatchService;
  11. use App\Station;
  12. use App\StationRuleBatch;
  13. use App\StationTask;
  14. use App\StationTaskBatch;
  15. use App\StationTaskCommodity;
  16. use App\StationTaskMaterialBox;
  17. use Tests\TestCase;
  18. use App\Traits\TestMockSubServices;
  19. class TempMarkBinProcessedTest extends TestCase
  20. {
  21. use TestMockSubServices;
  22. /** @var ForeignHaiRoboticsService $service */
  23. public $service;
  24. private $data;
  25. private $batchAmount = 1;
  26. private $orderAmount = 2;
  27. private $orderCommodityAmount = 4;
  28. function setUp(): void
  29. {
  30. parent::setUp();
  31. $this->service = $this->subMock([
  32. 'class' => ForeignHaiRoboticsService::class,
  33. // 'methods' => [
  34. // 'putBinToStore' => true,
  35. // ],
  36. 'subServices' => [
  37. [
  38. 'serviceName' => 'stationService',
  39. 'class' => StationService::class,
  40. 'methods' => [
  41. // 'broadcastBinMonitor' => true,
  42. ],
  43. ],
  44. ]
  45. ]);
  46. }
  47. public function testMarkBinProcessed()
  48. {
  49. $this->service->markBinProcessed(
  50. '',
  51. "8b839c28-f2e3-3d56-b34a-d9ac4fd81fa2",
  52. true,
  53. '',
  54. '',
  55. true);
  56. $this->assertTrue(true);
  57. }
  58. public function testMarkBinProcessed2()
  59. {
  60. $this->service->markBinProcessed(
  61. '',
  62. "8c2ae097-dad7-314c-b586-2d0eb2709b62",
  63. true,
  64. '',
  65. '',
  66. true);
  67. $this->assertTrue(true);
  68. }
  69. public function testMarkBinProcessed3()
  70. {
  71. $this->service->markBinProcessed(
  72. '',
  73. "fa61ad33-6598-339b-9a32-a73a4720b46b",
  74. true,
  75. '',
  76. '',
  77. true);
  78. $this->assertTrue(true);
  79. }
  80. public function testMarkBinProcessed4()
  81. {
  82. $this->service->markBinProcessed(
  83. '',
  84. "03c0bde8-b5d7-393d-918e-383d38a1efe9",
  85. true,
  86. '',
  87. '',
  88. true);
  89. $this->assertTrue(true);
  90. }
  91. public function testTaskUpdate()
  92. {
  93. $this->service->taskUpdate(
  94. '1739',
  95. 0,
  96. 0,
  97. "8b839c28-f2e3-3d56-b34a-d9ac4fd81fa2"
  98. );
  99. $this->assertTrue(true);
  100. }
  101. public function testTaskUpdate2()
  102. {
  103. $this->service->taskUpdate(
  104. '1738',
  105. 0,
  106. 0,
  107. "8c2ae097-dad7-314c-b586-2d0eb2709b62"
  108. );
  109. $this->assertTrue(true);
  110. }
  111. public function testTaskUpdate3()
  112. {
  113. $this->service->taskUpdate(
  114. '1737',
  115. 0,
  116. 0,
  117. "fa61ad33-6598-339b-9a32-a73a4720b46b"
  118. );
  119. $this->assertTrue(true);
  120. }
  121. public function testTaskUpdate4()
  122. {
  123. $this->service->taskUpdate(
  124. '1736',
  125. 0,
  126. 0,
  127. "03c0bde8-b5d7-393d-918e-383d38a1efe9"
  128. );
  129. $this->assertTrue(true);
  130. }
  131. function tearDown(): void
  132. {
  133. $materialBoxs=MaterialBox::query()->whereIn('code',['03c0bde8-b5d7-393d-918e-383d38a1efe9',
  134. 'fa61ad33-6598-339b-9a32-a73a4720b46b','8c2ae097-dad7-314c-b586-2d0eb2709b62','8b839c28-f2e3-3d56-b34a-d9ac4fd81fa2','03c0bde8-b5d7-393d-918e-383d38a1efe9'])->get();
  135. MaterialBox::query()->whereIn('id',data_get($materialBoxs,'*.id'))->delete();
  136. StationTaskMaterialBox::query()->whereIn('material_box_id',data_get($materialBoxs,'*.id'))->delete();
  137. parent::tearDown();
  138. }
  139. }