NOW MANAGED ON CODEBERG
Updated test files to be PSR-4 compliant
Dan Brownf84bf8e883e8
diff --git a/tests/Api/ApiAuthTest.php b/tests/Api/ApiAuthTest.phpindex 1f283753a..302093947 100644--- a/tests/Api/ApiAuthTest.php+++ b/tests/Api/ApiAuthTest.php@@ -1,10 +1,9 @@-<?php--namespace Tests;+<?php namespace Tests\Api;use BookStack\Auth\Permissions\RolePermission;use BookStack\Auth\User;use Carbon\Carbon;+use Tests\TestCase;class ApiAuthTest extends TestCase{diff --git a/tests/Api/ApiConfigTest.php b/tests/Api/ApiConfigTest.phpindex 1b3da2f34..def62c94d 100644--- a/tests/Api/ApiConfigTest.php+++ b/tests/Api/ApiConfigTest.php@@ -1,9 +1,6 @@-<?php+<?php namespace Tests\Api;-namespace Tests;--use BookStack\Auth\Permissions\RolePermission;-use Carbon\Carbon;+use Tests\TestCase;class ApiConfigTest extends TestCase{diff --git a/tests/Api/ApiDocsTest.php b/tests/Api/ApiDocsTest.phpindex b240c1672..3cbcadfa3 100644--- a/tests/Api/ApiDocsTest.php+++ b/tests/Api/ApiDocsTest.php@@ -1,6 +1,6 @@-<?php+<?php namespace Tests\Api;-namespace Tests;+use Tests\TestCase;class ApiDocsTest extends TestCase{diff --git a/tests/Api/ApiListingTest.php b/tests/Api/ApiListingTest.phpindex 741b9664b..ac6d61aa1 100644--- a/tests/Api/ApiListingTest.php+++ b/tests/Api/ApiListingTest.php@@ -1,8 +1,7 @@-<?php--namespace Tests;+<?php namespace Tests\Api;use BookStack\Entities\Book;+use Tests\TestCase;class ApiListingTest extends TestCase{diff --git a/tests/Api/BooksApiTest.php b/tests/Api/BooksApiTest.phpindex a40e4c93b..6f8753fb0 100644--- a/tests/Api/BooksApiTest.php+++ b/tests/Api/BooksApiTest.php@@ -1,6 +1,7 @@-<?php namespace Tests;+<?php namespace Tests\Api;use BookStack\Entities\Book;+use Tests\TestCase;class BooksApiTest extends TestCase{diff --git a/tests/TestsApi.php b/tests/Api/TestsApi.phpsimilarity index 96%rename from tests/TestsApi.phprename to tests/Api/TestsApi.phpindex 0bb10a4cc..623fa6969 100644--- a/tests/TestsApi.php+++ b/tests/Api/TestsApi.php@@ -1,6 +1,4 @@-<?php--namespace Tests;+<?php namespace Tests\Api;trait TestsApi{diff --git a/tests/Auth/AuthTest.php b/tests/Auth/AuthTest.phpindex eb83faded..cb27de961 100644--- a/tests/Auth/AuthTest.php+++ b/tests/Auth/AuthTest.php@@ -1,10 +1,11 @@-<?php namespace Tests;+<?php namespace Tests\Auth;use BookStack\Auth\User;use BookStack\Entities\Page;use BookStack\Notifications\ConfirmEmail;use BookStack\Settings\SettingService;use Illuminate\Support\Facades\Notification;+use Tests\BrowserKitTest;class AuthTest extends BrowserKitTest{diff --git a/tests/Auth/LdapTest.php b/tests/Auth/LdapTest.phpindex 324e3041f..de86b9fb6 100644--- a/tests/Auth/LdapTest.php+++ b/tests/Auth/LdapTest.php@@ -1,10 +1,11 @@-<?php namespace Tests;+<?php namespace Tests\Auth;use BookStack\Auth\Access\LdapService;use BookStack\Auth\Role;use BookStack\Auth\Access\Ldap;use BookStack\Auth\User;use Mockery\MockInterface;+use Tests\BrowserKitTest;class LdapTest extends BrowserKitTest{diff --git a/tests/Auth/Saml2Test.php b/tests/Auth/Saml2Test.phpindex 9a3d6d8ec..d0da45297 100644--- a/tests/Auth/Saml2Test.php+++ b/tests/Auth/Saml2Test.php@@ -1,7 +1,8 @@-<?php namespace Tests;+<?php namespace Tests\Auth;use BookStack\Auth\Role;use BookStack\Auth\User;+use Tests\TestCase;class Saml2Test extends TestCase{diff --git a/tests/Auth/SocialAuthTest.php b/tests/Auth/SocialAuthTest.phpindex 1a7a3fccc..d448b567e 100644--- a/tests/Auth/SocialAuthTest.php+++ b/tests/Auth/SocialAuthTest.php@@ -1,10 +1,11 @@-<?php namespace Tests;+<?php namespace Tests\Auth;use BookStack\Auth\User;use DB;use Laravel\Socialite\Contracts\Factory;use Laravel\Socialite\Contracts\Provider;use Mockery;+use Tests\TestCase;class SocialAuthTest extends TestCase{diff --git a/tests/Auth/UserInviteTest.php b/tests/Auth/UserInviteTest.phpindex d200134a5..f2a1d0e78 100644--- a/tests/Auth/UserInviteTest.php+++ b/tests/Auth/UserInviteTest.php@@ -1,4 +1,4 @@-<?php namespace Tests;+<?php namespace Tests\Auth;use BookStack\Auth\Access\UserInviteService;@@ -8,6 +8,7 @@ use Carbon\Carbon;use DB;use Illuminate\Support\Str;use Notification;+use Tests\TestCase;class UserInviteTest extends TestCase{diff --git a/tests/Entity/BookShelfTest.php b/tests/Entity/BookShelfTest.phpindex a318ebe24..f3d29f60c 100644--- a/tests/Entity/BookShelfTest.php+++ b/tests/Entity/BookShelfTest.php@@ -1,10 +1,11 @@-<?php namespace Tests;+<?php namespace Tests\Entity;use BookStack\Auth\User;use BookStack\Entities\Book;use BookStack\Entities\Bookshelf;use BookStack\Uploads\Image;use Illuminate\Support\Str;+use Tests\TestCase;use Tests\Uploads\UsesImages;class BookShelfTest extends TestCasediff --git a/tests/Entity/CommentSettingTest.php b/tests/Entity/CommentSettingTest.phpindex 967e550a7..3c8cae68c 100644--- a/tests/Entity/CommentSettingTest.php+++ b/tests/Entity/CommentSettingTest.php@@ -1,28 +1,35 @@-<?php namespace Tests;+<?php namespace Tests\Entity;-class CommentSettingTest extends BrowserKitTest {- protected $page;+use BookStack\Entities\Page;+use Tests\BrowserKitTest;- public function setUp(): void {- parent::setUp();- $this->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 filediff --git a/tests/Entity/CommentTest.php b/tests/Entity/CommentTest.phpindex 2b943f96f..a2126407b 100644--- a/tests/Entity/CommentTest.php+++ b/tests/Entity/CommentTest.php@@ -1,7 +1,8 @@-<?php namespace Tests;+<?php namespace Tests\Entity;use BookStack\Entities\Page;use BookStack\Actions\Comment;+use Tests\TestCase;class CommentTest extends TestCase{diff --git a/tests/Entity/EntitySearchTest.php b/tests/Entity/EntitySearchTest.phpindex 34c3cd4a8..72eb808dc 100644--- a/tests/Entity/EntitySearchTest.php+++ b/tests/Entity/EntitySearchTest.php@@ -1,10 +1,11 @@-<?php namespace Tests;+<?php namespace Tests\Entity;use BookStack\Actions\Tag;use BookStack\Entities\Book;use BookStack\Entities\Bookshelf;use BookStack\Entities\Chapter;use BookStack\Entities\Page;+use Tests\TestCase;class EntitySearchTest extends TestCase{diff --git a/tests/Entity/EntityTest.php b/tests/Entity/EntityTest.phpindex 97684ea4d..6d71d6090 100644--- a/tests/Entity/EntityTest.php+++ b/tests/Entity/EntityTest.php@@ -1,4 +1,4 @@-<?php namespace Tests;+<?php namespace Tests\Entity;use BookStack\Entities\Bookshelf;use BookStack\Entities\Book;@@ -7,6 +7,7 @@ use BookStack\Entities\Page;use BookStack\Auth\UserRepo;use BookStack\Entities\Repos\PageRepo;use Carbon\Carbon;+use Tests\BrowserKitTest;class EntityTest extends BrowserKitTest{diff --git a/tests/Entity/ExportTest.php b/tests/Entity/ExportTest.phpindex 9a2d32028..5a94adac9 100644--- a/tests/Entity/ExportTest.php+++ b/tests/Entity/ExportTest.php@@ -1,10 +1,11 @@-<?php namespace Tests;+<?php namespace Tests\Entity;use BookStack\Entities\Chapter;use BookStack\Entities\Page;use BookStack\Uploads\HttpFetcher;use Illuminate\Support\Str;+use Tests\TestCase;class ExportTest extends TestCase{diff --git a/tests/Entity/MarkdownTest.php b/tests/Entity/MarkdownTest.phpindex 5d3af4f6e..452b4c07f 100644--- a/tests/Entity/MarkdownTest.php+++ b/tests/Entity/MarkdownTest.php@@ -1,4 +1,6 @@-<?php namespace Tests;+<?php namespace Tests\Entity;++use Tests\BrowserKitTest;class MarkdownTest extends BrowserKitTest{diff --git a/tests/Entity/PageContentTest.php b/tests/Entity/PageContentTest.phpindex 8a78c8ac0..d714c3229 100644--- a/tests/Entity/PageContentTest.php+++ b/tests/Entity/PageContentTest.php@@ -1,7 +1,8 @@-<?php namespace Tests;+<?php namespace Tests\Entity;use BookStack\Entities\Managers\PageContent;use BookStack\Entities\Page;+use Tests\TestCase;class PageContentTest extends TestCase{diff --git a/tests/Entity/PageDraftTest.php b/tests/Entity/PageDraftTest.phpindex e83f78a10..5c984940d 100644--- a/tests/Entity/PageDraftTest.php+++ b/tests/Entity/PageDraftTest.php@@ -1,6 +1,7 @@-<?php namespace Tests;+<?php namespace Tests\Entity;use BookStack\Entities\Repos\PageRepo;+use Tests\BrowserKitTest;class PageDraftTest extends BrowserKitTest{diff --git a/tests/Entity/PageRevisionTest.php b/tests/Entity/PageRevisionTest.phpindex 38193ec1a..f8baccc54 100644--- a/tests/Entity/PageRevisionTest.php+++ b/tests/Entity/PageRevisionTest.php@@ -1,4 +1,4 @@-<?php namespace Entity;+<?php namespace Tests\Entity;use BookStack\Entities\Page;use BookStack\Entities\Repos\PageRepo;diff --git a/tests/Entity/PageTemplateTest.php b/tests/Entity/PageTemplateTest.phpindex 883de4a9f..8eba13557 100644--- a/tests/Entity/PageTemplateTest.php+++ b/tests/Entity/PageTemplateTest.php@@ -1,4 +1,4 @@-<?php namespace Entity;+<?php namespace Tests\Entity;use BookStack\Entities\Page;use Tests\TestCase;diff --git a/tests/Entity/SortTest.php b/tests/Entity/SortTest.phpindex 7d67f05c6..28c3adf31 100644--- a/tests/Entity/SortTest.php+++ b/tests/Entity/SortTest.php@@ -1,9 +1,10 @@-<?php namespace Tests;+<?php namespace Tests\Entity;use BookStack\Entities\Book;use BookStack\Entities\Chapter;use BookStack\Entities\Page;use BookStack\Entities\Repos\PageRepo;+use Tests\TestCase;class SortTest extends TestCase{diff --git a/tests/Entity/TagTest.php b/tests/Entity/TagTest.phpindex 13876410a..87d57ea0b 100644--- a/tests/Entity/TagTest.php+++ b/tests/Entity/TagTest.php@@ -1,4 +1,4 @@-<?php namespace Tests;+<?php namespace Tests\Entity;use BookStack\Entities\Book;use BookStack\Entities\Chapter;@@ -6,6 +6,7 @@ use BookStack\Actions\Tag;use BookStack\Entities\Entity;use BookStack\Entities\Page;use BookStack\Auth\Permissions\PermissionService;+use Tests\BrowserKitTest;class TagTest extends BrowserKitTest{diff --git a/tests/Permissions/RestrictionsTest.php b/tests/Permissions/RestrictionsTest.phpindex d899c6396..7d6c1831a 100644--- a/tests/Permissions/RestrictionsTest.php+++ b/tests/Permissions/RestrictionsTest.php@@ -1,4 +1,4 @@-<?php namespace Tests;+<?php namespace Tests\Permissions;use BookStack\Entities\Book;use BookStack\Entities\Bookshelf;@@ -6,6 +6,7 @@ use BookStack\Entities\Chapter;use BookStack\Entities\Entity;use BookStack\Auth\User;use BookStack\Entities\Page;+use Tests\BrowserKitTest;class RestrictionsTest extends BrowserKitTest{diff --git a/tests/Permissions/RolesTest.php b/tests/Permissions/RolesTest.phpindex 2ef72fb0a..99080d354 100644--- a/tests/Permissions/RolesTest.php+++ b/tests/Permissions/RolesTest.php@@ -1,4 +1,4 @@-<?php namespace Tests;+<?php namespace Tests\Permissions;use BookStack\Entities\Bookshelf;use BookStack\Entities\Page;@@ -6,6 +6,7 @@ use BookStack\Auth\Permissions\PermissionsRepo;use BookStack\Auth\Role;use Laravel\BrowserKitTesting\HttpException;use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;+use Tests\BrowserKitTest;class RolesTest extends BrowserKitTest{diff --git a/tests/Unit/ConfigTest.php b/tests/Unit/ConfigTest.phpindex c84305ad8..69b737d7d 100644--- a/tests/Unit/ConfigTest.php+++ b/tests/Unit/ConfigTest.php@@ -1,4 +1,6 @@-<?php namespace Tests;+<?php namespace Tests\Unit;++use Tests\TestCase;/*** Class ConfigTestdiff --git a/tests/Unit/UrlTest.php b/tests/Unit/UrlTest.phpindex c2386443c..feff47977 100644--- a/tests/Unit/UrlTest.php+++ b/tests/Unit/UrlTest.php@@ -1,4 +1,6 @@-<?php namespace Tests;+<?php namespace Tests\Unit;++use Tests\TestCase;class UrlTest extends TestCase{diff --git a/tests/Uploads/AttachmentTest.php b/tests/Uploads/AttachmentTest.phpindex 12b254d00..e98a90b35 100644--- a/tests/Uploads/AttachmentTest.php+++ b/tests/Uploads/AttachmentTest.php@@ -1,8 +1,9 @@-<?php namespace Tests;+<?php namespace Tests\Uploads;use BookStack\Uploads\Attachment;use BookStack\Entities\Page;use BookStack\Auth\Permissions\PermissionService;+use Tests\TestCase;class AttachmentTest extends TestCase{diff --git a/tests/Uploads/UsesImages.php b/tests/Uploads/UsesImages.phpindex b24b483d9..251a61c9f 100644--- a/tests/Uploads/UsesImages.php+++ b/tests/Uploads/UsesImages.php@@ -1,6 +1,5 @@<?php namespace Tests\Uploads;-use BookStack\Entities\Page;use Illuminate\Http\UploadedFile;diff --git a/tests/User/UserApiTokenTest.php b/tests/User/UserApiTokenTest.phpindex 7787e34fa..f738eb579 100644--- a/tests/User/UserApiTokenTest.php+++ b/tests/User/UserApiTokenTest.php@@ -1,4 +1,4 @@-<?php namespace Test;+<?php namespace Test\User;use BookStack\Api\ApiToken;use Carbon\Carbon;diff --git a/tests/User/UserPreferencesTest.php b/tests/User/UserPreferencesTest.phpindex b81664275..b70d52dfa 100644--- a/tests/User/UserPreferencesTest.php+++ b/tests/User/UserPreferencesTest.php@@ -1,4 +1,6 @@-<?php namespace Tests;+<?php namespace Test\User;++use Tests\TestCase;class UserPreferencesTest extends TestCase{diff --git a/tests/User/UserProfileTest.php b/tests/User/UserProfileTest.phpindex fc1a529ae..979064baa 100644--- a/tests/User/UserProfileTest.php+++ b/tests/User/UserProfileTest.php@@ -1,4 +1,6 @@-<?php namespace Tests;+<?php namespace Test\User;++use Tests\BrowserKitTest;class UserProfileTest extends BrowserKitTest{