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(); } }