get('/dashboard')->assertRedirect(route('login')); $this->get('/users')->assertRedirect(route('login')); $this->get('/settings')->assertRedirect(route('login')); } public function test_login_screen_renders(): void { $this->get('/login') ->assertOk() ->assertSee('Zaloguj') ->assertSee(__('auth.login_label')); } public function test_authenticated_admin_is_redirected_away_from_login(): void { $this->actingAsPanelAdmin() ->get('/login') ->assertRedirect('/dashboard'); } public function test_login_requires_credentials(): void { $this->from('/login') ->post('/login', []) ->assertRedirect('/login') ->assertSessionHasErrors(['login', 'password']); $this->assertGuest('ldap'); } public function test_logout_clears_the_session(): void { $this->actingAsPanelAdmin() ->withSession(['ad_admin' => ['login' => 'tester']]) ->post('/logout') ->assertRedirect(route('login')); $this->assertGuest('ldap'); } }