]> BookStack Code Mirror - bookstack/blobdiff - tests/Entity/CommentSettingTest.php
Added more complexity in an attempt to make ldap host failover fit
[bookstack] / tests / Entity / CommentSettingTest.php
index 0e3199979000b899d69fc5ac7c5fb5600eb10fe0..7de4574414f4e10feb2ea7c9c53dec929c739dbb 100644 (file)
@@ -2,34 +2,27 @@
 
 namespace Tests\Entity;
 
-use BookStack\Entities\Models\Page;
 use Tests\TestCase;
 
 class CommentSettingTest extends TestCase
 {
-    protected $page;
-
-    protected function setUp(): void
-    {
-        parent::setUp();
-        $this->page = Page::query()->first();
-    }
-
     public function test_comment_disable()
     {
+        $page = $this->entities->page();
         $this->setSettings(['app-disable-comments' => 'true']);
         $this->asAdmin();
 
-        $resp = $this->asAdmin()->get($this->page->getUrl());
+        $resp = $this->asAdmin()->get($page->getUrl());
         $this->withHtml($resp)->assertElementNotExists('.comments-list');
     }
 
     public function test_comment_enable()
     {
+        $page = $this->entities->page();
         $this->setSettings(['app-disable-comments' => 'false']);
         $this->asAdmin();
 
-        $resp = $this->asAdmin()->get($this->page->getUrl());
+        $resp = $this->asAdmin()->get($page->getUrl());
         $this->withHtml($resp)->assertElementExists('.comments-list');
     }
 }