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