fix(models): correct UserSetting import namespace and add test coverage

This commit is contained in:
2026-09-07 18:34:51 +02:00
parent 208efbb85d
commit 3502c3e85b
34 changed files with 2497 additions and 2 deletions
@@ -0,0 +1,49 @@
<?php
namespace Tests\Feature\Auth;
use App\Models\User;
use Illuminate\Auth\Notifications\ResetPassword;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Notification;
use Tests\TestCase;
class PasswordResetLinkControllerTest extends TestCase
{
use RefreshDatabase;
public function test_forgot_password_screen_can_be_rendered(): void
{
$response = $this->get('/forgot-password');
$response->assertStatus(200);
}
public function test_password_reset_link_can_be_requested(): void
{
Notification::fake();
$user = User::factory()->create();
$this->post('/forgot-password', ['email' => $user->email]);
Notification::assertSentTo($user, ResetPassword::class);
}
public function test_password_reset_link_fails_with_invalid_email(): void
{
$response = $this->post('/forgot-password', [
'email' => 'nonexistent@example.com',
]);
$response->assertSessionHasErrors('email');
}
public function test_password_reset_link_validates_email(): void
{
$response = $this->post('/forgot-password', [
'email' => '',
]);
$response->assertSessionHasErrors('email');
}
}