From f84bf8e883e8e5bd9a24b908e2f90a2742d36d19 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sat, 4 Apr 2020 01:16:05 +0100 Subject: [PATCH] Updated test files to be PSR-4 compliant Closes #1924 --- tests/Api/ApiAuthTest.php | 5 ++- tests/Api/ApiConfigTest.php | 7 ++-- tests/Api/ApiDocsTest.php | 4 +-- tests/Api/ApiListingTest.php | 5 ++- tests/Api/BooksApiTest.php | 3 +- tests/{ => Api}/TestsApi.php | 4 +-- tests/Auth/AuthTest.php | 3 +- tests/Auth/LdapTest.php | 3 +- tests/Auth/Saml2Test.php | 3 +- tests/Auth/SocialAuthTest.php | 3 +- tests/Auth/UserInviteTest.php | 3 +- tests/Entity/BookShelfTest.php | 3 +- tests/Entity/CommentSettingTest.php | 45 +++++++++++++++----------- tests/Entity/CommentTest.php | 3 +- tests/Entity/EntitySearchTest.php | 3 +- tests/Entity/EntityTest.php | 3 +- tests/Entity/ExportTest.php | 3 +- tests/Entity/MarkdownTest.php | 4 ++- tests/Entity/PageContentTest.php | 3 +- tests/Entity/PageDraftTest.php | 3 +- tests/Entity/PageRevisionTest.php | 2 +- tests/Entity/PageTemplateTest.php | 2 +- tests/Entity/SortTest.php | 3 +- tests/Entity/TagTest.php | 3 +- tests/Permissions/RestrictionsTest.php | 3 +- tests/Permissions/RolesTest.php | 3 +- tests/Unit/ConfigTest.php | 4 ++- tests/Unit/UrlTest.php | 4 ++- tests/Uploads/AttachmentTest.php | 3 +- tests/Uploads/UsesImages.php | 1 - tests/User/UserApiTokenTest.php | 2 +- tests/User/UserPreferencesTest.php | 4 ++- tests/User/UserProfileTest.php | 4 ++- 33 files changed, 89 insertions(+), 62 deletions(-) rename tests/{ => Api}/TestsApi.php (96%) diff --git a/tests/Api/ApiAuthTest.php b/tests/Api/ApiAuthTest.php index 1f283753a..302093947 100644 --- a/tests/Api/ApiAuthTest.php +++ b/tests/Api/ApiAuthTest.php @@ -1,10 +1,9 @@ -page = \BookStack\Entities\Page::first(); - } +class CommentSettingTest extends BrowserKitTest +{ + protected $page; - public function test_comment_disable () { - $this->asAdmin(); + public function setUp(): void + { + parent::setUp(); + $this->page = Page::first(); + } - $this->setSettings(['app-disable-comments' => 'true']); + public function test_comment_disable() + { + $this->asAdmin(); - $this->asAdmin()->visit($this->page->getUrl()) - ->pageNotHasElement('.comments-list'); - } + $this->setSettings(['app-disable-comments' => 'true']); - public function test_comment_enable () { - $this->asAdmin(); + $this->asAdmin()->visit($this->page->getUrl()) + ->pageNotHasElement('.comments-list'); + } - $this->setSettings(['app-disable-comments' => 'false']); + public function test_comment_enable() + { + $this->asAdmin(); - $this->asAdmin()->visit($this->page->getUrl()) - ->pageHasElement('.comments-list'); - } + $this->setSettings(['app-disable-comments' => 'false']); + + $this->asAdmin()->visit($this->page->getUrl()) + ->pageHasElement('.comments-list'); + } } \ No newline at end of file diff --git a/tests/Entity/CommentTest.php b/tests/Entity/CommentTest.php index 2b943f96f..a2126407b 100644 --- a/tests/Entity/CommentTest.php +++ b/tests/Entity/CommentTest.php @@ -1,7 +1,8 @@ -