From 5ff99b53b907e6ff75f97bfe5de2f1db20c156dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Wit?= Date: Wed, 20 Mar 2024 10:12:38 +0100 Subject: [PATCH] Fix testing migrations not working while running tests (#102) --- tests/Integration/AbstractIntegrationTestCase.php | 1 + tests/Integration/GraphQL/Mutations/LoginTest.php | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/Integration/AbstractIntegrationTestCase.php b/tests/Integration/AbstractIntegrationTestCase.php index 87c9f99..580ab24 100644 --- a/tests/Integration/AbstractIntegrationTestCase.php +++ b/tests/Integration/AbstractIntegrationTestCase.php @@ -49,6 +49,7 @@ protected function getPackageProviders($app): array protected function defineDatabaseMigrations(): void { $this->loadLaravelMigrations(); + $this->loadMigrationsFrom(__DIR__.'/../stubs/migrations'); } /** diff --git a/tests/Integration/GraphQL/Mutations/LoginTest.php b/tests/Integration/GraphQL/Mutations/LoginTest.php index eb34f65..447294f 100644 --- a/tests/Integration/GraphQL/Mutations/LoginTest.php +++ b/tests/Integration/GraphQL/Mutations/LoginTest.php @@ -64,8 +64,6 @@ public function it_logs_a_user_in_using_custom_user_identifier(): void $this->app['config']->set('auth.providers.users.model', UserHasApiTokensIdentifiedByUsername::class); $this->app['config']->set('lighthouse-sanctum.user_identifier_field_name', 'username'); - $this->loadMigrationsFrom('./tests/stubs/migrations'); - UserHasApiTokensIdentifiedByUsername::factory()->create([ 'username' => 'john.doe', 'password' => Hash::make('supersecret'),