mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
fix logout issue #31
This commit is contained in:
29
tests/Feature/Http/Auth/LogoutTest.php
Normal file
29
tests/Feature/Http/Auth/LogoutTest.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?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(route('login'));
|
||||
|
||||
$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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user