| 12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- namespace Tests\Services\CacheShelfService;
- use App\MaterialBox;
- use App\Services\CacheShelfService;
- use App\Station;
- use Tests\TestCase;
- class StationCacheBroadCastTest extends TestCase
- {
- /** @var CacheShelfService $service */
- protected $service;
- protected $data = [];
- protected function setUp(): void
- {
- parent::setUp();
- $this->service = app(CacheShelfService::class);
- $this->data['parentStation'] = factory(Station::class)->create(['code'=>'testParent']);
- $this->data['station'] = factory(Station::class)->create(['code' => 'test','parent_id' => $this->data['parentStation']]);
- $this->data['materialBox'] = factory(MaterialBox::class)->create(['code'=>'testCode']);
- $this->service->createStationTask($this->data['station']['code'],$this->data['materialBox']);
- }
- public function test(){
- $this->service->_stationCacheBroadCast($this->data['station']['code'],0);
- }
- protected function tearDown(): void
- {
- Station::query()->whereIn('id',[$this->data['station']['id'],$this->data['parentStation']['0']]);
- parent::tearDown();
- }
- }
|