X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/1ee3e779e4b9b0a92f701a72f21a72c83cb1ce68..refs/pull/3593/head:/tests/Entity/CommentSettingTest.php diff --git a/tests/Entity/CommentSettingTest.php b/tests/Entity/CommentSettingTest.php index 967e550a7..0e3199979 100644 --- a/tests/Entity/CommentSettingTest.php +++ b/tests/Entity/CommentSettingTest.php @@ -1,28 +1,35 @@ -page = \BookStack\Entities\Page::first(); - } +use BookStack\Entities\Models\Page; +use Tests\TestCase; - public function test_comment_disable () { - $this->asAdmin(); +class CommentSettingTest extends TestCase +{ + protected $page; - $this->setSettings(['app-disable-comments' => 'true']); + protected function setUp(): void + { + parent::setUp(); + $this->page = Page::query()->first(); + } - $this->asAdmin()->visit($this->page->getUrl()) - ->pageNotHasElement('.comments-list'); - } + public function test_comment_disable() + { + $this->setSettings(['app-disable-comments' => 'true']); + $this->asAdmin(); - public function test_comment_enable () { - $this->asAdmin(); + $resp = $this->asAdmin()->get($this->page->getUrl()); + $this->withHtml($resp)->assertElementNotExists('.comments-list'); + } - $this->setSettings(['app-disable-comments' => 'false']); + public function test_comment_enable() + { + $this->setSettings(['app-disable-comments' => 'false']); + $this->asAdmin(); - $this->asAdmin()->visit($this->page->getUrl()) - ->pageHasElement('.comments-list'); - } -} \ No newline at end of file + $resp = $this->asAdmin()->get($this->page->getUrl()); + $this->withHtml($resp)->assertElementExists('.comments-list'); + } +}