diff --git a/tests/Controller/API/LinkApiTest.php b/tests/Controller/API/LinkApiTest.php index a0c8fb12..448d95ae 100644 --- a/tests/Controller/API/LinkApiTest.php +++ b/tests/Controller/API/LinkApiTest.php @@ -6,14 +6,12 @@ use App\Jobs\SaveLinkToWaybackmachine; use App\Models\Link; use App\Models\LinkList; use App\Models\Tag; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\Queue; class LinkApiTest extends ApiTestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testUnauthorizedRequest(): void { diff --git a/tests/Controller/API/LinkCheckApiTest.php b/tests/Controller/API/LinkCheckApiTest.php index 1ab40546..e891c1ea 100644 --- a/tests/Controller/API/LinkCheckApiTest.php +++ b/tests/Controller/API/LinkCheckApiTest.php @@ -3,13 +3,11 @@ namespace Tests\Controller\API; use App\Models\Link; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; class LinkCheckApiTest extends ApiTestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testUnauthorizedRequest(): void { diff --git a/tests/Controller/API/LinkNotesTest.php b/tests/Controller/API/LinkNotesTest.php index 4ccc1e3f..54fb4643 100644 --- a/tests/Controller/API/LinkNotesTest.php +++ b/tests/Controller/API/LinkNotesTest.php @@ -4,15 +4,11 @@ namespace Tests\Controller\API; use App\Models\Link; use App\Models\Note; -use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; -use Tests\TestCase; +use Illuminate\Foundation\Testing\RefreshDatabase; class LinkNotesTest extends ApiTestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testLinksRequest(): void { diff --git a/tests/Controller/API/ListApiTest.php b/tests/Controller/API/ListApiTest.php index 00b40d37..099fcaf6 100644 --- a/tests/Controller/API/ListApiTest.php +++ b/tests/Controller/API/ListApiTest.php @@ -3,13 +3,11 @@ namespace Tests\Controller\API; use App\Models\LinkList; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; class ListApiTest extends ApiTestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testUnauthorizedRequest(): void { diff --git a/tests/Controller/API/ListLinksTest.php b/tests/Controller/API/ListLinksTest.php index a0d7b629..81598ad2 100644 --- a/tests/Controller/API/ListLinksTest.php +++ b/tests/Controller/API/ListLinksTest.php @@ -4,15 +4,11 @@ namespace Tests\Controller\API; use App\Models\Link; use App\Models\LinkList; -use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; -use Tests\TestCase; +use Illuminate\Foundation\Testing\RefreshDatabase; class ListLinksTest extends ApiTestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testLinksRequest(): void { @@ -26,8 +22,8 @@ class ListLinksTest extends ApiTestCase $response->assertOk() ->assertJson([ 'data' => [ - ['url' => $link->url] - ] + ['url' => $link->url], + ], ]); } @@ -39,7 +35,7 @@ class ListLinksTest extends ApiTestCase $response->assertOk() ->assertJson([ - 'data' => [] + 'data' => [], ]); $responseBody = json_decode($response->content()); diff --git a/tests/Controller/API/NoteApiTest.php b/tests/Controller/API/NoteApiTest.php index 055cae75..37c58456 100644 --- a/tests/Controller/API/NoteApiTest.php +++ b/tests/Controller/API/NoteApiTest.php @@ -4,13 +4,11 @@ namespace Tests\Controller\API; use App\Models\Link; use App\Models\Note; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; class NoteApiTest extends ApiTestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testMinimalCreateRequest(): void { diff --git a/tests/Controller/API/SearchListsTest.php b/tests/Controller/API/SearchListsTest.php index 09e21572..77fda18d 100644 --- a/tests/Controller/API/SearchListsTest.php +++ b/tests/Controller/API/SearchListsTest.php @@ -3,13 +3,11 @@ namespace Tests\Controller\API; use App\Models\LinkList; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; class SearchListsTest extends ApiTestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testUnauthorizedRequest(): void { diff --git a/tests/Controller/API/SearchTagsTest.php b/tests/Controller/API/SearchTagsTest.php index 97d6473c..e64a6daf 100644 --- a/tests/Controller/API/SearchTagsTest.php +++ b/tests/Controller/API/SearchTagsTest.php @@ -3,13 +3,11 @@ namespace Tests\Controller\API; use App\Models\Tag; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; class SearchTagsTest extends ApiTestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testUnauthorizedRequest(): void { diff --git a/tests/Controller/API/TagApiTest.php b/tests/Controller/API/TagApiTest.php index 715c61f6..61a48b54 100644 --- a/tests/Controller/API/TagApiTest.php +++ b/tests/Controller/API/TagApiTest.php @@ -3,13 +3,11 @@ namespace Tests\Controller\API; use App\Models\Tag; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; class TagApiTest extends ApiTestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testUnauthorizedRequest(): void { diff --git a/tests/Controller/API/TagLinksTest.php b/tests/Controller/API/TagLinksTest.php index 0df25e47..2984ce6f 100644 --- a/tests/Controller/API/TagLinksTest.php +++ b/tests/Controller/API/TagLinksTest.php @@ -4,15 +4,11 @@ namespace Tests\Controller\API; use App\Models\Link; use App\Models\Tag; -use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; -use Tests\TestCase; +use Illuminate\Foundation\Testing\RefreshDatabase; class TagLinksTest extends ApiTestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testLinksRequest(): void { diff --git a/tests/Controller/API/TrashApiTest.php b/tests/Controller/API/TrashApiTest.php index 01d0aa11..a6ee5605 100644 --- a/tests/Controller/API/TrashApiTest.php +++ b/tests/Controller/API/TrashApiTest.php @@ -6,15 +6,13 @@ use App\Models\Link; use App\Models\LinkList; use App\Models\Note; use App\Models\Tag; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\DB; use Tests\Controller\Traits\PreparesTrash; class TrashApiTest extends ApiTestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; use PreparesTrash; protected function setUp(): void diff --git a/tests/Controller/App/BookmarkletControllerTest.php b/tests/Controller/App/BookmarkletControllerTest.php index 7640f3a5..38bc0426 100644 --- a/tests/Controller/App/BookmarkletControllerTest.php +++ b/tests/Controller/App/BookmarkletControllerTest.php @@ -3,14 +3,12 @@ namespace Tests\Controller\App; use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class BookmarkletControllerTest extends TestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testValidBookmarkletResponse(): void { diff --git a/tests/Controller/App/DashboardControllerTest.php b/tests/Controller/App/DashboardControllerTest.php index 48cd9151..fa650bf7 100644 --- a/tests/Controller/App/DashboardControllerTest.php +++ b/tests/Controller/App/DashboardControllerTest.php @@ -3,14 +3,12 @@ namespace Tests\Controller\App; use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class DashboardControllerTest extends TestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testValidDashboardResponse(): void { diff --git a/tests/Controller/App/ExportControllerTest.php b/tests/Controller/App/ExportControllerTest.php index d5bea0b9..a65d50ea 100644 --- a/tests/Controller/App/ExportControllerTest.php +++ b/tests/Controller/App/ExportControllerTest.php @@ -4,14 +4,12 @@ namespace Tests\Controller\App; use App\Models\Link; use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class ExportControllerTest extends TestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; private $user; diff --git a/tests/Controller/App/ImportControllerTest.php b/tests/Controller/App/ImportControllerTest.php index 0c6a1647..60c2f248 100644 --- a/tests/Controller/App/ImportControllerTest.php +++ b/tests/Controller/App/ImportControllerTest.php @@ -4,15 +4,13 @@ namespace Tests\Controller\App; use App\Models\Link; use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Http\UploadedFile; use Tests\TestCase; class ImportControllerTest extends TestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; private $user; diff --git a/tests/Controller/App/SearchControllerTest.php b/tests/Controller/App/SearchControllerTest.php index 72e603f1..172586ae 100644 --- a/tests/Controller/App/SearchControllerTest.php +++ b/tests/Controller/App/SearchControllerTest.php @@ -6,14 +6,12 @@ use App\Models\Link; use App\Models\LinkList; use App\Models\Tag; use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class SearchControllerTest extends TestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; private $user; diff --git a/tests/Controller/App/SystemSettingsControllerTest.php b/tests/Controller/App/SystemSettingsControllerTest.php index bdbb3d91..d2afb882 100644 --- a/tests/Controller/App/SystemSettingsControllerTest.php +++ b/tests/Controller/App/SystemSettingsControllerTest.php @@ -10,6 +10,7 @@ class SystemSettingsControllerTest extends TestCase { use RefreshDatabase; + /** @var User */ private $user; public function setUp(): void diff --git a/tests/Controller/App/TrashControllerTest.php b/tests/Controller/App/TrashControllerTest.php index 6eea4e2b..884729e3 100644 --- a/tests/Controller/App/TrashControllerTest.php +++ b/tests/Controller/App/TrashControllerTest.php @@ -7,16 +7,14 @@ use App\Models\LinkList; use App\Models\Note; use App\Models\Tag; use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Support\Facades\DB; use Tests\Controller\Traits\PreparesTrash; use Tests\TestCase; class TrashControllerTest extends TestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; use PreparesTrash; /** @var User */ diff --git a/tests/Controller/App/UserSettingsControllerTest.php b/tests/Controller/App/UserSettingsControllerTest.php index 808a214c..ec2c0ec4 100644 --- a/tests/Controller/App/UserSettingsControllerTest.php +++ b/tests/Controller/App/UserSettingsControllerTest.php @@ -11,6 +11,7 @@ class UserSettingsControllerTest extends TestCase { use RefreshDatabase; + /** @var User */ private $user; public function setUp(): void diff --git a/tests/Controller/Auth/LoginControllerTest.php b/tests/Controller/Auth/LoginControllerTest.php index 3efa0782..8fdf78a6 100644 --- a/tests/Controller/Auth/LoginControllerTest.php +++ b/tests/Controller/Auth/LoginControllerTest.php @@ -3,14 +3,12 @@ namespace Tests\Controller\Auth; use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class LoginControllerTest extends TestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testValidLoginResponse(): void { diff --git a/tests/Controller/Guest/GuestControllerTest.php b/tests/Controller/Guest/GuestControllerTest.php index 777b0120..2de19abf 100644 --- a/tests/Controller/Guest/GuestControllerTest.php +++ b/tests/Controller/Guest/GuestControllerTest.php @@ -3,14 +3,12 @@ namespace Tests\Controller\Guest; use App\Models\Setting; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class GuestControllerTest extends TestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testGuestModeEnabled(): void { diff --git a/tests/Controller/Guest/LinkControllerTest.php b/tests/Controller/Guest/LinkControllerTest.php index 6414316d..a3b300f8 100644 --- a/tests/Controller/Guest/LinkControllerTest.php +++ b/tests/Controller/Guest/LinkControllerTest.php @@ -5,14 +5,12 @@ namespace Tests\Controller\Guest; use App\Models\Link; use App\Models\Setting; use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class LinkControllerTest extends TestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; public function testValidLinkOverviewResponse(): void { diff --git a/tests/Controller/Guest/ListControllerTest.php b/tests/Controller/Guest/ListControllerTest.php index e8caef6e..a4f687ae 100644 --- a/tests/Controller/Guest/ListControllerTest.php +++ b/tests/Controller/Guest/ListControllerTest.php @@ -5,14 +5,12 @@ namespace Tests\Controller\Guest; use App\Models\LinkList; use App\Models\Setting; use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class ListControllerTest extends TestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; protected function setUp(): void { diff --git a/tests/Controller/Guest/TagControllerTest.php b/tests/Controller/Guest/TagControllerTest.php index a1b43fca..03b6cd74 100644 --- a/tests/Controller/Guest/TagControllerTest.php +++ b/tests/Controller/Guest/TagControllerTest.php @@ -5,14 +5,12 @@ namespace Tests\Controller\Guest; use App\Models\Setting; use App\Models\Tag; use App\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class TagControllerTest extends TestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; protected function setUp(): void { diff --git a/tests/Controller/Setup/MetaControllerTest.php b/tests/Controller/Setup/MetaControllerTest.php index fb92ad19..0c179cc0 100644 --- a/tests/Controller/Setup/MetaControllerTest.php +++ b/tests/Controller/Setup/MetaControllerTest.php @@ -2,14 +2,12 @@ namespace Tests\Controller\Setup; -use Illuminate\Foundation\Testing\DatabaseMigrations; -use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class MetaControllerTest extends TestCase { - use DatabaseTransactions; - use DatabaseMigrations; + use RefreshDatabase; protected function setUp(): void { @@ -31,7 +29,7 @@ class MetaControllerTest extends TestCase $response = $this->get('/'); - $response->assertStatus(200); + $response->assertOk(); } public function testRedirectIfSetupCompleted(): void @@ -47,7 +45,7 @@ class MetaControllerTest extends TestCase { $response = $this->get('setup/start'); - $response->assertStatus(200) + $response->assertOk() ->assertSee('Welcome to the LinkAce setup'); } }