From 0563d577ed30f49f93ae4d2761349b26781fc8b8 Mon Sep 17 00:00:00 2001 From: Paul Isaris Date: Fri, 4 Oct 2024 17:43:16 +0300 Subject: [PATCH] Reverted User Factory --- database/factories/UserFactory.php | 1 - tests/Feature/Controllers/UserControllerTest.php | 6 ++++++ .../Questionnaire/QuestionnaireAnswerVoteRepositoryTest.php | 4 ---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index de487bc6..709ee872 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -15,7 +15,6 @@ class UserFactory extends Factory { */ public function definition() { return [ - 'id' => $this->faker->unique()->numberBetween(1, 10000), 'nickname' => $this->faker->name, 'avatar' => $this->faker->imageUrl(), 'email' => $this->faker->unique()->safeEmail, diff --git a/tests/Feature/Controllers/UserControllerTest.php b/tests/Feature/Controllers/UserControllerTest.php index 580d0f95..662038b7 100644 --- a/tests/Feature/Controllers/UserControllerTest.php +++ b/tests/Feature/Controllers/UserControllerTest.php @@ -6,9 +6,15 @@ use App\Http\Middleware\VerifyCsrfToken; use App\Models\User; use App\Models\UserRole; +use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class UserControllerTest extends TestCase { + + use RefreshDatabase; + + protected $seed = true; + /** @test */ public function myDashboardDisplaysDashboardForAuthenticated_user() { $user = User::factory()->create(); diff --git a/tests/Unit/Repository/Questionnaire/QuestionnaireAnswerVoteRepositoryTest.php b/tests/Unit/Repository/Questionnaire/QuestionnaireAnswerVoteRepositoryTest.php index df9819a9..c38ad6db 100644 --- a/tests/Unit/Repository/Questionnaire/QuestionnaireAnswerVoteRepositoryTest.php +++ b/tests/Unit/Repository/Questionnaire/QuestionnaireAnswerVoteRepositoryTest.php @@ -7,13 +7,9 @@ use App\Models\User; use App\Repository\Questionnaire\Responses\QuestionnaireAnswerVoteRepository; use Illuminate\Contracts\Container\BindingResolutionException; -use Illuminate\Foundation\Testing\RefreshDatabase; use Tests\TestCase; class QuestionnaireAnswerVoteRepositoryTest extends TestCase { - use RefreshDatabase; - - protected $seed = true; /** @test * @throws BindingResolutionException