Fix SessionTest

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-08-09 16:13:54 +02:00
parent 26bf0ca9d4
commit 1ea7f14f0a
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 11 additions and 0 deletions

View File

@ -434,6 +434,9 @@ class SessionTest extends \Test\TestCase {
->method('getSystemValue') ->method('getSystemValue')
->with('token_auth_enforced', false) ->with('token_auth_enforced', false)
->will($this->returnValue(false)); ->will($this->returnValue(false));
$manager->method('getByEmail')
->with('unexist')
->willReturn([]);
$this->assertFalse($userSession->logClientIn('unexist', 'doe', $request, $this->throttler)); $this->assertFalse($userSession->logClientIn('unexist', 'doe', $request, $this->throttler));
} }
@ -1163,6 +1166,10 @@ class SessionTest extends \Test\TestCase {
->method('getTime') ->method('getTime')
->will($this->returnValue(100)); ->will($this->returnValue(100));
$manager->method('getByEmail')
->with('john')
->willReturn([]);
$userSession->logClientIn('john', 'doe', $request, $this->throttler); $userSession->logClientIn('john', 'doe', $request, $this->throttler);
$this->assertEquals(10000, $token->getLastActivity()); $this->assertEquals(10000, $token->getLastActivity());
@ -1213,6 +1220,10 @@ class SessionTest extends \Test\TestCase {
->method('getTime') ->method('getTime')
->will($this->returnValue(100)); ->will($this->returnValue(100));
$manager->method('getByEmail')
->with('john')
->willReturn([]);
$userSession->logClientIn('john', 'doe', $request, $this->throttler); $userSession->logClientIn('john', 'doe', $request, $this->throttler);
} }