feat: include testing, factories, git workflow for testing.
All checks were successful
Tests / Laravel tests (pull_request) Successful in 3m31s

This commit is contained in:
2026-06-03 21:23:39 +02:00
parent d83fce834a
commit 9df6c0ab46
20 changed files with 732 additions and 13 deletions

View File

@@ -0,0 +1,19 @@
<?php
use App\Models\User;
test('guests cannot access profile management routes', function () {
$this->get(route('profile.edit'))->assertRedirect(route('login'));
$this->patch(route('profile.update'), [])->assertRedirect(route('login'));
$this->delete(route('profile.destroy'), [])->assertRedirect(route('login'));
});
test('the profile edit page receives the authenticated user', function () {
$user = User::factory()->create();
$this->actingAs($user)
->get(route('profile.edit'))
->assertOk()
->assertViewIs('profile.edit')
->assertViewHas('user', fn (User $viewUser) => $viewUser->is($user));
});