Skip to content

Commit 2d29ed8

Browse files
committed
Test sitemap is not generated when conditions are not met
1 parent b682739 commit 2d29ed8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,14 @@ public function testSitemapIsGeneratedWhenConditionsAreMet()
2626

2727
Filesystem::unlink('_site/sitemap.xml');
2828
}
29+
30+
public function testSitemapIsNotGeneratedWhenConditionsAreNotMet()
31+
{
32+
config(['hyde.url' => '']);
33+
34+
$this->assertFileDoesNotExist(Hyde::path('_site/sitemap.xml'));
35+
36+
$this->artisan('build:sitemap')->assertExitCode(0);
37+
$this->assertFileDoesNotExist(Hyde::path('_site/sitemap.xml'));
38+
}
2939
}

0 commit comments

Comments
 (0)