-
-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathLogoutTest.php
More file actions
37 lines (29 loc) · 1019 Bytes
/
LogoutTest.php
File metadata and controls
37 lines (29 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php declare(strict_types=1);
namespace LivewireUI\Spotlight\Tests\Commands;
use Illuminate\Contracts\Auth\StatefulGuard;
use LivewireUI\Spotlight\Commands\Logout;
use LivewireUI\Spotlight\Spotlight;
use PHPUnit\Framework\TestCase;
class LogoutTest extends TestCase
{
/** @test */
public function it_logs_out_the_current_user(): void
{
$spotlight = $this->createMock(Spotlight::class);
$guardMock = $this->createMock(StatefulGuard::class);
$guardMock->expects($this->once())->method('logout');
$command = new Logout();
$command->execute($spotlight, $guardMock);
}
/** @test */
public function it_redirects_after_logout(): void
{
$spotlight = $this->createMock(Spotlight::class);
$spotlight->expects($this->once())
->method('redirect')
->with('/');
$guardMock = $this->createMock(StatefulGuard::class);
$command = new Logout();
$command->execute($spotlight, $guardMock);
}
}