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