first work
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Rodev\DelegateAuth\Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Rodev\DelegateAuth\Tests\Fixtures\User;
|
||||
use Rodev\DelegateAuth\Tests\TestCase;
|
||||
|
||||
class LogoutTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_logout_disconnects_authenticated_user_and_redirects(): void
|
||||
{
|
||||
$user = User::create(['email' => 'user@example.com']);
|
||||
|
||||
$this->actingAs($user)
|
||||
->post(route('delegate-auth.logout'))
|
||||
->assertRedirect('/');
|
||||
|
||||
$this->assertGuest();
|
||||
}
|
||||
|
||||
public function test_logout_as_guest_still_redirects(): void
|
||||
{
|
||||
$this->post(route('delegate-auth.logout'))
|
||||
->assertRedirect('/');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user