]> BookStack Code Mirror - bookstack/commitdiff
Updated test files to be PSR-4 compliant
authorDan Brown <redacted>
Sat, 4 Apr 2020 00:16:05 +0000 (01:16 +0100)
committerDan Brown <redacted>
Sat, 4 Apr 2020 00:16:05 +0000 (01:16 +0100)
Closes #1924

33 files changed:
tests/Api/ApiAuthTest.php
tests/Api/ApiConfigTest.php
tests/Api/ApiDocsTest.php
tests/Api/ApiListingTest.php
tests/Api/BooksApiTest.php
tests/Api/TestsApi.php [moved from tests/TestsApi.php with 96% similarity]
tests/Auth/AuthTest.php
tests/Auth/LdapTest.php
tests/Auth/Saml2Test.php
tests/Auth/SocialAuthTest.php
tests/Auth/UserInviteTest.php
tests/Entity/BookShelfTest.php
tests/Entity/CommentSettingTest.php
tests/Entity/CommentTest.php
tests/Entity/EntitySearchTest.php
tests/Entity/EntityTest.php
tests/Entity/ExportTest.php
tests/Entity/MarkdownTest.php
tests/Entity/PageContentTest.php
tests/Entity/PageDraftTest.php
tests/Entity/PageRevisionTest.php
tests/Entity/PageTemplateTest.php
tests/Entity/SortTest.php
tests/Entity/TagTest.php
tests/Permissions/RestrictionsTest.php
tests/Permissions/RolesTest.php
tests/Unit/ConfigTest.php
tests/Unit/UrlTest.php
tests/Uploads/AttachmentTest.php
tests/Uploads/UsesImages.php
tests/User/UserApiTokenTest.php
tests/User/UserPreferencesTest.php
tests/User/UserProfileTest.php

index 1f283753ae9dc02f83d2dddd0c4107d4aa4b7604..3020939479b355ab0d91fab30e6dc3acedb2288e 100644 (file)
@@ -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
 {
index 1b3da2f34f8d19c8c0df42ceccea045dbea208ac..def62c94dd40465899f3e794e2c6b7897a963ff4 100644 (file)
@@ -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
 {
index b240c1672d17fb219f98c4f0c1338aaba5efd544..3cbcadfa30759d4197bbc8775370b0b954760590 100644 (file)
@@ -1,6 +1,6 @@
-<?php
+<?php namespace Tests\Api;
 
-namespace Tests;
+use Tests\TestCase;
 
 class ApiDocsTest extends TestCase
 {
index 741b9664b9a8dece27895705cf961b9cddc4dc98..ac6d61aa142c85d1c4e005d85c2ecb1a7e3be454 100644 (file)
@@ -1,8 +1,7 @@
-<?php
-
-namespace Tests;
+<?php namespace Tests\Api;
 
 use BookStack\Entities\Book;
+use Tests\TestCase;
 
 class ApiListingTest extends TestCase
 {
index a40e4c93b6c43aab535dee805b78a7c91b6517a3..6f8753fb05ce0cd16a73aeb7b9a5245a9784d2fa 100644 (file)
@@ -1,6 +1,7 @@
-<?php namespace Tests;
+<?php namespace Tests\Api;
 
 use BookStack\Entities\Book;
+use Tests\TestCase;
 
 class BooksApiTest extends TestCase
 {
similarity index 96%
rename from tests/TestsApi.php
rename to tests/Api/TestsApi.php
index 0bb10a4cc764c22941a0c0c99b280c7b59587bf6..623fa6969a7128bf9652f9e50e16fa710d29ac54 100644 (file)
@@ -1,6 +1,4 @@
-<?php
-
-namespace Tests;
+<?php namespace Tests\Api;
 
 trait TestsApi
 {
index eb83faded44edc67d721e595d1a11d3861e12255..cb27de96170ec8517a4befc6a27d8b99e95f3d0e 100644 (file)
@@ -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
 {
index 324e3041fa5a6e29433116e1fb70a318bc08bcb5..de86b9fb68a2465860b71078778f0a65f526d79b 100644 (file)
@@ -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
 {
index 9a3d6d8ecabb27acedb25957d2bef56920913009..d0da4529735adcb7e2dfe0229c768cac4552aa2e 100644 (file)
@@ -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
 {
index 1a7a3fccce4d3ea6a0ef69340c228ede6979752e..d448b567e5ef1462bf168500bc2dc6b8ed1df2f2 100644 (file)
@@ -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
 {
index d200134a5548707b52966d445d13dff1ef096316..f2a1d0e78177e94330515b37eb924e19770c9c95 100644 (file)
@@ -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
 {
index a318ebe24e5be48cd29b7559c25679db6d02e44a..f3d29f60cd41dcaaacfc05cab19d274111c75ace 100644 (file)
@@ -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 TestCase
index 967e550a735e6294faf970bcfc1a605b8a57c2f7..3c8cae68ccefefd1e28f0aca63884c28dfdf0b33 100644 (file)
@@ -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 file
index 2b943f96f18c853dfd36f805110f7eb0715b0666..a2126407b43d121b10f6c55cad07eda7d0455b25 100644 (file)
@@ -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
 {
index 34c3cd4a873dd14274884c558e3411e9b09511c9..72eb808dc4c581a84e03d85c74366ee79d3b238a 100644 (file)
@@ -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
 {
index 97684ea4d66fc174e82c8c8b81b55a35488193d7..6d71d6090777aa6ad4dddc7065e00df37e648400 100644 (file)
@@ -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
 {
index 9a2d32028e4b26887c7d231b68df2b1887668e3a..5a94adac91c4b8d8dc46866f897e45f7057c3808 100644 (file)
@@ -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
 {
index 5d3af4f6e26705b8fed3e617a78d9104fe3fb99d..452b4c07f379ed1a1ed4e7e1c747192ca541700c 100644 (file)
@@ -1,4 +1,6 @@
-<?php namespace Tests;
+<?php namespace Tests\Entity;
+
+use Tests\BrowserKitTest;
 
 class MarkdownTest extends BrowserKitTest
 {
index 8a78c8ac019fd08de3cc37d50e7df50954c83f6e..d714c3229db7a8dfeecd587c67b0d9f41cde4457 100644 (file)
@@ -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
 {
index e83f78a10a8a8f2d566ece9586a115dd24d4c323..5c984940d32569ce3e0b5d1cdce60bef2bf9d1cb 100644 (file)
@@ -1,6 +1,7 @@
-<?php namespace Tests;
+<?php namespace Tests\Entity;
 
 use BookStack\Entities\Repos\PageRepo;
+use Tests\BrowserKitTest;
 
 class PageDraftTest extends BrowserKitTest
 {
index 38193ec1a6b7bd09cadbe04e6a8bcb3ea8765f98..f8baccc5493f84e7ac0ce388bc81d837a8cdacf0 100644 (file)
@@ -1,4 +1,4 @@
-<?php namespace Entity;
+<?php namespace Tests\Entity;
 
 use BookStack\Entities\Page;
 use BookStack\Entities\Repos\PageRepo;
index 883de4a9f91f98f1b67dfcb83676c06d2a5489ae..8eba1355792f593be11a7431c6f6866eaa3732cc 100644 (file)
@@ -1,4 +1,4 @@
-<?php namespace Entity;
+<?php namespace Tests\Entity;
 
 use BookStack\Entities\Page;
 use Tests\TestCase;
index 7d67f05c6d6b0b77be7dde916d3c497c512d0482..28c3adf312682fa84783a78634eb946681c98e70 100644 (file)
@@ -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
 {
index 13876410a0cddccaf4e3d04783e5735ccfd78697..87d57ea0bf547b8cf76bc6ca2c3a8bfd45f341c2 100644 (file)
@@ -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
 {
index d899c6396041a9d8a46d695efff0599ce0159a83..7d6c1831afdd0eeab6ecceb36b3b5f8127f61981 100644 (file)
@@ -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
 {
index 2ef72fb0aef8999403553d00819ae59ea9a2acf4..99080d354c4c239fae8261e8de53d06681b7e7fe 100644 (file)
@@ -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
 {
index c84305ad88112354a418f6e9c01a58cded82b9eb..69b737d7df4ac3a88b03b0fcbffa07467d516a6b 100644 (file)
@@ -1,4 +1,6 @@
-<?php namespace Tests;
+<?php namespace Tests\Unit;
+
+use Tests\TestCase;
 
 /**
  * Class ConfigTest
index c2386443c6fdacd9260cc8b5bfb7777c74a5c208..feff4797718baa4904dce7d80dcbaf4aca5180a6 100644 (file)
@@ -1,4 +1,6 @@
-<?php namespace Tests;
+<?php namespace Tests\Unit;
+
+use Tests\TestCase;
 
 class UrlTest extends TestCase
 {
index 12b254d00a4c84ac87877d8e3e49917163f7c071..e98a90b35d2034aaa701a726a42fcb5de4939b30 100644 (file)
@@ -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
 {
index b24b483d945ec1e7f510ac621bdd6244fdec49a4..251a61c9f5841c2ad9513fbfc7140594b3adb4fc 100644 (file)
@@ -1,6 +1,5 @@
 <?php namespace Tests\Uploads;
 
-
 use BookStack\Entities\Page;
 use Illuminate\Http\UploadedFile;
 
index 7787e34fa94991722dbefadb08ed9079c7baa412..f738eb579e4f9a836bc7f818e7de39e59a78ace9 100644 (file)
@@ -1,4 +1,4 @@
-<?php namespace Test;
+<?php namespace Test\User;
 
 use BookStack\Api\ApiToken;
 use Carbon\Carbon;
index b8166427525dcf74006f3fdfa0b60dd2779eeea0..b70d52dfa85f3d3dea3a5d1d378d2c9cd17f5951 100644 (file)
@@ -1,4 +1,6 @@
-<?php namespace Tests;
+<?php namespace Test\User;
+
+use Tests\TestCase;
 
 class UserPreferencesTest extends TestCase
 {
index fc1a529ae43076f59d38d2d642c534c0ff816cd7..979064baa64d5aec99c4737cfd14b9607ecfa258 100644 (file)
@@ -1,4 +1,6 @@
-<?php namespace Tests;
+<?php namespace Test\User;
+
+use Tests\BrowserKitTest;
 
 class UserProfileTest extends BrowserKitTest
 {
Morty Proxy This is a proxified and sanitized view of the page, visit original site.