outputDisk)->delete($this->outputPath); }); afterEach(function () { /** @var \Uwil\SitemapGenerator\Tests\TestCase $this */ Storage::disk($this->outputDisk)->delete($this->outputPath); }); it('generates and writes the sitemap to storage when handled', function () { /** @var \Uwil\SitemapGenerator\Tests\TestCase $this */ // GIVEN Route::name('contact')->get('/{locale}/contact', fn () => 'contact'); config()->set(SitemapConfig::CONFIG_KEY . '.single_pages', ['contact']); // WHEN GenerateSitemapJob::dispatchSync(); // THEN expect(Storage::disk($this->outputDisk)->exists($this->outputPath))->toBeTrue(); $content = Storage::disk($this->outputDisk)->get($this->outputPath); expect($content) ->toContain('toContain('/fr/contact') ->toContain('/en/contact'); }); it('can be dispatched to queue', function () { // GIVEN Queue::fake(); // WHEN GenerateSitemapJob::dispatch(); // THEN Queue::assertPushed(GenerateSitemapJob::class); }); });