mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-05-03 16:24:55 +00:00
27 lines
630 B
PHP
27 lines
630 B
PHP
<?php
|
|
|
|
use App\Livewire\Actions\Logout;
|
|
|
|
it('logs the authenticated user out and redirects to /', function () {
|
|
actingAsUser();
|
|
|
|
expect(auth()->check())->toBeTrue();
|
|
|
|
$response = (new Logout)();
|
|
|
|
expect($response->getTargetUrl())->toBe(url('/'));
|
|
expect(auth()->check())->toBeFalse();
|
|
});
|
|
|
|
it('still produces a redirect when invoked without an authenticated session', function () {
|
|
$response = (new Logout)();
|
|
|
|
expect($response->getTargetUrl())->toBe(url('/'));
|
|
});
|
|
|
|
it('is registered for the POST /logout route', function () {
|
|
actingAsUser();
|
|
|
|
$this->post('/logout')->assertRedirect('/');
|
|
});
|