]> BookStack Code Mirror - bookstack/blob - tests/Entity/CommentSettingTest.php
Laravel 8 shift squash & merge (#3029)
[bookstack] / tests / Entity / CommentSettingTest.php
1 <?php
2
3 namespace Tests\Entity;
4
5 use BookStack\Entities\Models\Page;
6 use Tests\TestCase;
7
8 class CommentSettingTest extends TestCase
9 {
10     protected $page;
11
12     protected function setUp(): void
13     {
14         parent::setUp();
15         $this->page = Page::query()->first();
16     }
17
18     public function test_comment_disable()
19     {
20         $this->setSettings(['app-disable-comments' => 'true']);
21         $this->asAdmin();
22
23         $this->asAdmin()->get($this->page->getUrl())
24             ->assertElementNotExists('.comments-list');
25     }
26
27     public function test_comment_enable()
28     {
29         $this->setSettings(['app-disable-comments' => 'false']);
30         $this->asAdmin();
31
32         $this->asAdmin()->get($this->page->getUrl())
33             ->assertElementExists('.comments-list');
34     }
35 }