]> BookStack Code Mirror - bookstack/blobdiff - tests/Entity/CommentSettingTest.php
Added login throttling test, updated reset-pw test method names
[bookstack] / tests / Entity / CommentSettingTest.php
index 967e550a735e6294faf970bcfc1a605b8a57c2f7..0e3199979000b899d69fc5ac7c5fb5600eb10fe0 100644 (file)
@@ -1,28 +1,35 @@
-<?php namespace Tests;
+<?php
 
-class CommentSettingTest extends BrowserKitTest {
-  protected $page;
+namespace Tests\Entity;
 
-  public function setUp(): void {
-      parent::setUp();
-      $this->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');
+    }
+}