seed(RolePermissionSeeder::class); $admin = User::factory()->create(['is_active' => true]); $admin->assignRole('admin'); $this->actingAs($admin) ->getJson('/api/quality-reviews?current_only=true&page=1&per_page=15') ->assertOk() ->assertJsonPath('current_page', 1); } public function test_uploaded_avatar_is_served_from_public_media_endpoint(): void { Storage::fake('public'); Storage::disk('public')->put('avatars/profile-test.jpg', 'avatar-content'); $response = $this->get('/api/media/avatars/profile-test.jpg') ->assertOk(); $this->assertStringContainsString('public', (string) $response->headers->get('cache-control')); $this->assertStringContainsString('max-age=86400', (string) $response->headers->get('cache-control')); } public function test_session_probe_is_successful_for_guests_and_authenticated_users(): void { $this->getJson('/api/auth/me') ->assertOk() ->assertJsonPath('authenticated', false) ->assertJsonPath('data', null); $user = User::factory()->create(['is_active' => true]); $this->actingAs($user) ->getJson('/api/auth/me') ->assertOk() ->assertJsonPath('authenticated', true) ->assertJsonPath('data.id', $user->id); } }