| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <?php
- namespace Tests\Services\ForeignHaiRoboticsService;
- use App\Batch;
- use App\MaterialBox;
- use App\Order;
- use App\OrderCommodity;
- use App\Services\BatchService;
- use App\Services\ForeignHaiRoboticsService;
- use App\Services\StationService;
- use App\Services\StationTaskBatchService;
- use App\Station;
- use App\StationRuleBatch;
- use App\StationTask;
- use App\StationTaskBatch;
- use App\StationTaskCommodity;
- use App\StationTaskMaterialBox;
- use Tests\TestCase;
- use App\Traits\TestMockSubServices;
- class TempMarkBinProcessedTest extends TestCase
- {
- use TestMockSubServices;
- /** @var ForeignHaiRoboticsService $service */
- public $service;
- private $data;
- private $batchAmount = 1;
- private $orderAmount = 2;
- private $orderCommodityAmount = 4;
- function setUp(): void
- {
- parent::setUp();
- $this->service = $this->subMock([
- 'class' => ForeignHaiRoboticsService::class,
- // 'methods' => [
- // 'putBinToStore' => true,
- // ],
- 'subServices' => [
- [
- 'serviceName' => 'stationService',
- 'class' => StationService::class,
- 'methods' => [
- // 'broadcastBinMonitor' => true,
- ],
- ],
- ]
- ]);
- }
- public function testMarkBinProcessed()
- {
- $this->service->markBinProcessed(
- '',
- "8b839c28-f2e3-3d56-b34a-d9ac4fd81fa2",
- true,
- '',
- '',
- true);
- $this->assertTrue(true);
- }
- public function testMarkBinProcessed2()
- {
- $this->service->markBinProcessed(
- '',
- "8c2ae097-dad7-314c-b586-2d0eb2709b62",
- true,
- '',
- '',
- true);
- $this->assertTrue(true);
- }
- public function testMarkBinProcessed3()
- {
- $this->service->markBinProcessed(
- '',
- "fa61ad33-6598-339b-9a32-a73a4720b46b",
- true,
- '',
- '',
- true);
- $this->assertTrue(true);
- }
- public function testMarkBinProcessed4()
- {
- $this->service->markBinProcessed(
- '',
- "03c0bde8-b5d7-393d-918e-383d38a1efe9",
- true,
- '',
- '',
- true);
- $this->assertTrue(true);
- }
- public function testTaskUpdate()
- {
- $this->service->taskUpdate(
- '1739',
- 0,
- 0,
- "8b839c28-f2e3-3d56-b34a-d9ac4fd81fa2"
- );
- $this->assertTrue(true);
- }
- public function testTaskUpdate2()
- {
- $this->service->taskUpdate(
- '1738',
- 0,
- 0,
- "8c2ae097-dad7-314c-b586-2d0eb2709b62"
- );
- $this->assertTrue(true);
- }
- public function testTaskUpdate3()
- {
- $this->service->taskUpdate(
- '1737',
- 0,
- 0,
- "fa61ad33-6598-339b-9a32-a73a4720b46b"
- );
- $this->assertTrue(true);
- }
- public function testTaskUpdate4()
- {
- $this->service->taskUpdate(
- '1736',
- 0,
- 0,
- "03c0bde8-b5d7-393d-918e-383d38a1efe9"
- );
- $this->assertTrue(true);
- }
- function tearDown(): void
- {
- $materialBoxs=MaterialBox::query()->whereIn('code',['03c0bde8-b5d7-393d-918e-383d38a1efe9',
- 'fa61ad33-6598-339b-9a32-a73a4720b46b','8c2ae097-dad7-314c-b586-2d0eb2709b62','8b839c28-f2e3-3d56-b34a-d9ac4fd81fa2','03c0bde8-b5d7-393d-918e-383d38a1efe9'])->get();
- MaterialBox::query()->whereIn('id',data_get($materialBoxs,'*.id'))->delete();
- StationTaskMaterialBox::query()->whereIn('material_box_id',data_get($materialBoxs,'*.id'))->delete();
- parent::tearDown();
- }
- }
|