forked from 404labfr/laravel-impersonate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Lab404\Tests; | ||
|
||
use Lab404\Tests\Stubs\Models\User; | ||
|
||
class SessionGuardTest extends TestCase | ||
{ | ||
/** @var String $guard */ | ||
private $guard; | ||
|
||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->guard = 'web'; | ||
} | ||
|
||
/** @test */ | ||
public function it_removes_password_hash_from_session() | ||
{ | ||
$hashName = 'password_hash_' . $this->guard; | ||
$this->app['auth']->guard($this->guard)->loginUsingId('[email protected]'); | ||
$this->app['auth']->guard($this->guard)->getSession()->put($hashName, 'test_hash'); | ||
$this->app['auth']->guard($this->guard)->quietLogout(); | ||
$this->assertFalse($this->app['auth']->guard($this->guard)->check()); | ||
$this->assertFalse($this->app['auth']->guard($this->guard)->getSession()->has($hashName)); | ||
} | ||
} |