2021-06-26 15:23:15 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Entity;
|
2017-11-16 23:32:36 +05:30
|
|
|
|
2021-05-29 23:42:21 +01:00
|
|
|
use Tests\TestCase;
|
2017-11-16 23:32:36 +05:30
|
|
|
|
2021-05-29 23:42:21 +01:00
|
|
|
class CommentSettingTest extends TestCase
|
2020-04-04 01:16:05 +01:00
|
|
|
{
|
|
|
|
public function test_comment_disable()
|
|
|
|
{
|
2022-09-29 22:11:16 +01:00
|
|
|
$page = $this->entities->page();
|
2020-04-04 01:16:05 +01:00
|
|
|
$this->setSettings(['app-disable-comments' => 'true']);
|
2021-05-29 23:42:21 +01:00
|
|
|
$this->asAdmin();
|
2017-11-16 23:32:36 +05:30
|
|
|
|
2022-09-29 22:11:16 +01:00
|
|
|
$resp = $this->asAdmin()->get($page->getUrl());
|
2022-07-23 15:10:18 +01:00
|
|
|
$this->withHtml($resp)->assertElementNotExists('.comments-list');
|
2020-04-04 01:16:05 +01:00
|
|
|
}
|
2017-11-16 23:32:36 +05:30
|
|
|
|
2020-04-04 01:16:05 +01:00
|
|
|
public function test_comment_enable()
|
|
|
|
{
|
2022-09-29 22:11:16 +01:00
|
|
|
$page = $this->entities->page();
|
2020-04-04 01:16:05 +01:00
|
|
|
$this->setSettings(['app-disable-comments' => 'false']);
|
2021-05-29 23:42:21 +01:00
|
|
|
$this->asAdmin();
|
2020-04-04 01:16:05 +01:00
|
|
|
|
2022-09-29 22:11:16 +01:00
|
|
|
$resp = $this->asAdmin()->get($page->getUrl());
|
2022-07-23 15:10:18 +01:00
|
|
|
$this->withHtml($resp)->assertElementExists('.comments-list');
|
2020-04-04 01:16:05 +01:00
|
|
|
}
|
2021-06-26 15:23:15 +00:00
|
|
|
}
|