Skip to content

Commit 5801af2

Browse files
committed
Clean up sitemap file when done
This is more fault tolerant
1 parent d8aaa38 commit 5801af2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/framework/tests/Feature/Commands/BuildSitemapCommandTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Hyde\Framework\Testing\Feature\Commands;
66

7-
use Hyde\Facades\Filesystem;
87
use Hyde\Hyde;
98
use Hyde\Testing\TestCase;
109

@@ -18,6 +17,8 @@ public function testSitemapIsGeneratedWhenConditionsAreMet()
1817
{
1918
config(['hyde.url' => 'https://example.com']);
2019

20+
$this->cleanUpWhenDone('_site/sitemap.xml');
21+
2122
$this->assertFileDoesNotExist(Hyde::path('_site/sitemap.xml'));
2223

2324
$this->artisan('build:sitemap')
@@ -27,8 +28,6 @@ public function testSitemapIsGeneratedWhenConditionsAreMet()
2728
->assertExitCode(0);
2829

2930
$this->assertFileExists(Hyde::path('_site/sitemap.xml'));
30-
31-
Filesystem::unlink('_site/sitemap.xml');
3231
}
3332

3433
public function testSitemapIsNotGeneratedWhenConditionsAreNotMet()

0 commit comments

Comments
 (0)