vito/tests/Feature/Http/Auth/LogoutTest.php
Saeed Vaziry 9030427f78
Two factor (#47)
* init 2fa

* fix code style
2023-09-11 20:47:44 +02:00

30 lines
596 B
PHP

<?php
namespace Tests\Feature\Http\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());
}
}