diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index da828b7..69afa0a 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -600,48 +600,6 @@ parameters: count: 2 path: app/Services/Streams/StatsService.php - - - message: '#^Unreachable statement \- code above always terminates\.$#' - identifier: deadCode.unreachable - count: 4 - path: tests/Feature/Auth/AuthenticationTest.php - - - - message: '#^Unreachable statement \- code above always terminates\.$#' - identifier: deadCode.unreachable - count: 4 - path: tests/Feature/Auth/PasswordResetTest.php - - - - message: '#^Unreachable statement \- code above always terminates\.$#' - identifier: deadCode.unreachable - count: 1 - path: tests/Feature/Auth/RegistrationTest.php - - - - message: '#^Unreachable statement \- code above always terminates\.$#' - identifier: deadCode.unreachable - count: 1 - path: tests/Feature/Auth/TwoFactorChallengeTest.php - - - - message: '#^Unreachable statement \- code above always terminates\.$#' - identifier: deadCode.unreachable - count: 2 - path: tests/Feature/Auth/VerificationNotificationTest.php - - - - message: '#^Unreachable statement \- code above always terminates\.$#' - identifier: deadCode.unreachable - count: 2 - path: tests/Feature/Settings/PasswordUpdateTest.php - - - - message: '#^Unreachable statement \- code above always terminates\.$#' - identifier: deadCode.unreachable - count: 4 - path: tests/Feature/Settings/ProfileUpdateTest.php - - message: '#^Access to an undefined property Illuminate\\Database\\Eloquent\\Model\:\:\$allocation_type\.$#' identifier: property.notFound diff --git a/tests/Feature/Auth/AuthenticationTest.php b/tests/Feature/Auth/AuthenticationTest.php index 1fe7df9..c5bb3f8 100644 --- a/tests/Feature/Auth/AuthenticationTest.php +++ b/tests/Feature/Auth/AuthenticationTest.php @@ -21,8 +21,6 @@ public function test_login_screen_can_be_rendered() public function test_users_can_authenticate_using_the_login_screen() { - $this->markTestSkipped('CSRF token issue in test environment'); - $user = User::factory()->withoutTwoFactor()->create(); $response = $this->post(route('login.store'), [ @@ -36,8 +34,6 @@ public function test_users_can_authenticate_using_the_login_screen() public function test_users_with_two_factor_enabled_are_redirected_to_two_factor_challenge() { - $this->markTestSkipped('CSRF token issue in test environment'); - if (! Features::canManageTwoFactorAuthentication()) { $this->markTestSkipped('Two-factor authentication is not enabled.'); } @@ -79,20 +75,16 @@ public function test_users_can_not_authenticate_with_invalid_password() public function test_users_can_logout() { - $this->markTestSkipped('CSRF token issue in test environment'); - $user = User::factory()->create(); $response = $this->actingAs($user)->post(route('logout')); $this->assertGuest(); - $response->assertRedirect(route('home')); + $response->assertRedirect('/'); } public function test_users_are_rate_limited() { - $this->markTestSkipped('CSRF token issue in test environment'); - $user = User::factory()->create(); RateLimiter::increment(md5('login'.implode('|', [$user->email, '127.0.0.1'])), amount: 5); diff --git a/tests/Feature/Auth/PasswordResetTest.php b/tests/Feature/Auth/PasswordResetTest.php index 17446a6..426b468 100644 --- a/tests/Feature/Auth/PasswordResetTest.php +++ b/tests/Feature/Auth/PasswordResetTest.php @@ -21,7 +21,7 @@ public function test_reset_password_link_screen_can_be_rendered() public function test_reset_password_link_can_be_requested() { - $this->markTestSkipped('CSRF token issue in test environment'); + Notification::fake(); $user = User::factory()->create(); @@ -33,7 +33,7 @@ public function test_reset_password_link_can_be_requested() public function test_reset_password_screen_can_be_rendered() { - $this->markTestSkipped('CSRF token issue in test environment'); + Notification::fake(); $user = User::factory()->create(); @@ -51,8 +51,6 @@ public function test_reset_password_screen_can_be_rendered() public function test_password_can_be_reset_with_valid_token() { - $this->markTestSkipped('CSRF token issue in test environment'); - Notification::fake(); $user = User::factory()->create(); @@ -77,7 +75,7 @@ public function test_password_can_be_reset_with_valid_token() public function test_password_cannot_be_reset_with_invalid_token() { - $this->markTestSkipped('CSRF token issue in test environment'); + $user = User::factory()->create(); $response = $this->post(route('password.update'), [ diff --git a/tests/Feature/Auth/RegistrationTest.php b/tests/Feature/Auth/RegistrationTest.php index 887f763..16cc907 100644 --- a/tests/Feature/Auth/RegistrationTest.php +++ b/tests/Feature/Auth/RegistrationTest.php @@ -18,8 +18,6 @@ public function test_registration_screen_can_be_rendered() public function test_new_users_can_register() { - $this->markTestSkipped('CSRF token issue in test environment'); - $response = $this->post(route('register.store'), [ 'name' => 'Test User', 'email' => 'test@example.com', diff --git a/tests/Feature/Auth/TwoFactorChallengeTest.php b/tests/Feature/Auth/TwoFactorChallengeTest.php index 85f97c4..b8d6b80 100644 --- a/tests/Feature/Auth/TwoFactorChallengeTest.php +++ b/tests/Feature/Auth/TwoFactorChallengeTest.php @@ -25,8 +25,6 @@ public function test_two_factor_challenge_redirects_to_login_when_not_authentica public function test_two_factor_challenge_can_be_rendered(): void { - $this->markTestSkipped('Auth routes not integrated with scenario pages'); - if (! Features::canManageTwoFactorAuthentication()) { $this->markTestSkipped('Two-factor authentication is not enabled.'); } diff --git a/tests/Feature/Auth/VerificationNotificationTest.php b/tests/Feature/Auth/VerificationNotificationTest.php index 2e62bee..4e5da05 100644 --- a/tests/Feature/Auth/VerificationNotificationTest.php +++ b/tests/Feature/Auth/VerificationNotificationTest.php @@ -14,8 +14,6 @@ class VerificationNotificationTest extends TestCase public function test_sends_verification_notification(): void { - $this->markTestSkipped('Auth routes not integrated with scenario pages'); - Notification::fake(); $user = User::factory()->create([ @@ -24,15 +22,13 @@ public function test_sends_verification_notification(): void $this->actingAs($user) ->post(route('verification.send')) - ->assertRedirect(route('home')); + ->assertRedirect('/'); Notification::assertSentTo($user, VerifyEmail::class); } public function test_does_not_send_verification_notification_if_email_is_verified(): void { - $this->markTestSkipped('Auth routes not integrated with scenario pages'); - Notification::fake(); $user = User::factory()->create([ diff --git a/tests/Feature/Settings/PasswordUpdateTest.php b/tests/Feature/Settings/PasswordUpdateTest.php index 788d4dc..81cec8f 100644 --- a/tests/Feature/Settings/PasswordUpdateTest.php +++ b/tests/Feature/Settings/PasswordUpdateTest.php @@ -24,8 +24,6 @@ public function test_password_update_page_is_displayed() public function test_password_can_be_updated() { - $this->markTestSkipped('Auth routes not integrated with scenario pages'); - $user = User::factory()->create(); $response = $this @@ -46,8 +44,6 @@ public function test_password_can_be_updated() public function test_correct_password_must_be_provided_to_update_password() { - $this->markTestSkipped('Auth routes not integrated with scenario pages'); - $user = User::factory()->create(); $response = $this diff --git a/tests/Feature/Settings/ProfileUpdateTest.php b/tests/Feature/Settings/ProfileUpdateTest.php index e301823..3235a75 100644 --- a/tests/Feature/Settings/ProfileUpdateTest.php +++ b/tests/Feature/Settings/ProfileUpdateTest.php @@ -23,8 +23,6 @@ public function test_profile_page_is_displayed() public function test_profile_information_can_be_updated() { - $this->markTestSkipped('Auth routes not integrated with scenario pages'); - $user = User::factory()->create(); $response = $this @@ -47,8 +45,6 @@ public function test_profile_information_can_be_updated() public function test_email_verification_status_is_unchanged_when_the_email_address_is_unchanged() { - $this->markTestSkipped('Auth routes not integrated with scenario pages'); - $user = User::factory()->create(); $response = $this @@ -67,8 +63,6 @@ public function test_email_verification_status_is_unchanged_when_the_email_addre public function test_user_can_delete_their_account() { - $this->markTestSkipped('Auth routes not integrated with scenario pages'); - $user = User::factory()->create(); $response = $this @@ -79,7 +73,7 @@ public function test_user_can_delete_their_account() $response ->assertSessionHasNoErrors() - ->assertRedirect(route('home')); + ->assertRedirect('/'); $this->assertGuest(); $this->assertNull($user->fresh()); @@ -87,8 +81,6 @@ public function test_user_can_delete_their_account() public function test_correct_password_must_be_provided_to_delete_account() { - $this->markTestSkipped('Auth routes not integrated with scenario pages'); - $user = User::factory()->create(); $response = $this