subSeconds(300); $this->service=app(StoreService::class); $this->asnHeaders=OracleDOCASNHeader::query() ->with(['asnType', 'asnStatus', 'asnDetails' => function ($query) { $query->with(['lineStatus', 'qualityStatus','basSku']); }]) ->where('EditTime', '>=', $startDate) ->whereColumn('EditTime', '<>', 'addTime') ->get(); } public function testUpdateStore(){ if (!$this->asnHeaders) { $this->assertNull($this->asnHeaders); }else{ $this->service->updateStore($this->asnHeaders); $this->stores=$this->service->getByWms($this->asnHeaders); $this->assertNotNull($this->stores); } } public function tearDown(): void { $storeIds=[]; foreach ($this->stores as $store){ array_push($storeIds,$store->id); } DB::table('stores')->whereIn('asn_code',data_get($this->asnHeaders,'*.asnno'))->delete(); DB::table('store_items')->whereIn('store_id',$storeIds)->delete(); cache()->flush(); parent::tearDown(); // TODO: Change the autogenerated stub } }