From 0504058c01350cc743f14a0cf8a7f5f8dd429197 Mon Sep 17 00:00:00 2001 From: hackerESQ Date: Mon, 25 Aug 2025 20:21:22 -0500 Subject: [PATCH] fix: auth tests failing if env shows self hosted --- tests/AuthenticationTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/AuthenticationTest.php b/tests/AuthenticationTest.php index ad11c2b..6020dc1 100644 --- a/tests/AuthenticationTest.php +++ b/tests/AuthenticationTest.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace Tests; use App\Models\User; -use Illuminate\Support\Facades\Log; use Illuminate\Foundation\Testing\RefreshDatabase; class AuthenticationTest extends TestCase @@ -14,15 +13,17 @@ class AuthenticationTest extends TestCase public function test_first_user_is_admin(): void { - $this->post('/register', [ + $response = $this->post('/register', [ 'name' => 'should_be_admin', 'email' => 'should_be_admin@example.net', 'password' => 'password', 'password_confirmation' => 'password', + 'terms' => 1, ]); $should_be_admin = User::where(['email' => 'should_be_admin@example.net'])->first(); + $this->assertModelExists($should_be_admin); $this->assertTrue($should_be_admin->admin); } @@ -35,10 +36,12 @@ class AuthenticationTest extends TestCase 'email' => 'not_admin@example.net', 'password' => 'password', 'password_confirmation' => 'password', + 'terms' => 1, ]); $not_admin = User::where(['email' => 'not_admin@example.net'])->first(); + $this->assertModelExists($not_admin); $this->assertNotTrue($not_admin->admin); }