service = app('BatchService'); $this->data['Batches'] = factory(Batch::class, $this->amount) ->create(); } public function testReturned() { $this->service->assignTasks($this->data['Batches']); $this->assertTrue(true); } function tearDown(): void { Batch::query() ->whereIn('id',data_get($this->data['Batches'],'*.id')??[]) ->delete(); parent::tearDown(); } }