vito/tests/Feature/Auth/LogoutTest.php
Saeed Vaziry f70963d6bb
fix notification chanels and more tests (#108)
* fix notification chanels and more tests

* fix code style
2024-02-16 21:10:17 +01:00

30 lines
591 B
PHP

<?php
namespace Tests\Feature\Auth;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class LogoutTest extends TestCase
{
use RefreshDatabase;
public function test_logout(): void
{
$this->actingAs($this->user);
$this->post(route('logout'))->assertRedirect('/');
$this->assertFalse(auth()->check());
}
public function test_user_still_logged_in(): void
{
$this->actingAs($this->user);
$this->get(route('login'))->assertRedirect(route('servers'));
$this->assertTrue(auth()->check());
}
}