2020-04-03 20:16:05 -04:00
|
|
|
<?php namespace Tests\Entity;
|
2017-11-16 13:02:36 -05:00
|
|
|
|
2020-11-21 19:17:45 -05:00
|
|
|
use BookStack\Entities\Models\Page;
|
2020-04-03 20:16:05 -04:00
|
|
|
use Tests\BrowserKitTest;
|
2017-11-16 13:02:36 -05:00
|
|
|
|
2020-04-03 20:16:05 -04:00
|
|
|
class CommentSettingTest extends BrowserKitTest
|
|
|
|
{
|
|
|
|
protected $page;
|
2017-11-16 13:02:36 -05:00
|
|
|
|
2020-04-03 20:16:05 -04:00
|
|
|
public function setUp(): void
|
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
$this->page = Page::first();
|
|
|
|
}
|
2017-11-16 13:02:36 -05:00
|
|
|
|
2020-04-03 20:16:05 -04:00
|
|
|
public function test_comment_disable()
|
|
|
|
{
|
|
|
|
$this->asAdmin();
|
2017-11-16 13:02:36 -05:00
|
|
|
|
2020-04-03 20:16:05 -04:00
|
|
|
$this->setSettings(['app-disable-comments' => 'true']);
|
2017-11-16 13:02:36 -05:00
|
|
|
|
2020-04-03 20:16:05 -04:00
|
|
|
$this->asAdmin()->visit($this->page->getUrl())
|
|
|
|
->pageNotHasElement('.comments-list');
|
|
|
|
}
|
2017-11-16 13:02:36 -05:00
|
|
|
|
2020-04-03 20:16:05 -04:00
|
|
|
public function test_comment_enable()
|
|
|
|
{
|
|
|
|
$this->asAdmin();
|
2017-11-16 13:02:36 -05:00
|
|
|
|
2020-04-03 20:16:05 -04:00
|
|
|
$this->setSettings(['app-disable-comments' => 'false']);
|
|
|
|
|
|
|
|
$this->asAdmin()->visit($this->page->getUrl())
|
|
|
|
->pageHasElement('.comments-list');
|
|
|
|
}
|
2017-11-16 13:02:36 -05:00
|
|
|
}
|