mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Added test to prove stateless login sets user
This commit is contained in:
parent
f22129b9c7
commit
c63de8d9f5
1 changed files with 19 additions and 0 deletions
|
@ -1721,6 +1721,25 @@ class AuthComponentTest extends CakeTestCase {
|
|||
$this->Auth->startup($this->Controller);
|
||||
}
|
||||
|
||||
/**
|
||||
* testStatelessLoginSetsUser method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testStatelessLoginSetsUser() {
|
||||
$user = array(
|
||||
'id' => 1,
|
||||
'username' => 'mark'
|
||||
);
|
||||
|
||||
AuthComponent::$sessionKey = false;
|
||||
$result = $this->Auth->login($user);
|
||||
$this->assertTrue($result);
|
||||
|
||||
$this->assertTrue($this->Auth->loggedIn());
|
||||
$this->assertEquals($user, $this->Auth->user());
|
||||
}
|
||||
|
||||
/**
|
||||
* testStatelessAuthNoSessionStart method
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue