|
|
@ -158,7 +158,7 @@ class SessionTest extends \Test\TestCase { |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
->method('getToken') |
|
|
|
->method('getToken') |
|
|
|
->with('bar') |
|
|
|
->with('bar') |
|
|
|
->will($this->throwException(new InvalidTokenException())); |
|
|
|
->willThrowException(new InvalidTokenException()); |
|
|
|
$session->expects($this->exactly(2)) |
|
|
|
$session->expects($this->exactly(2)) |
|
|
|
->method('set') |
|
|
|
->method('set') |
|
|
|
->with($this->callback(function ($key) { |
|
|
|
->with($this->callback(function ($key) { |
|
|
@ -238,7 +238,7 @@ class SessionTest extends \Test\TestCase { |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
->method('getToken') |
|
|
|
->method('getToken') |
|
|
|
->with('bar') |
|
|
|
->with('bar') |
|
|
|
->will($this->throwException(new InvalidTokenException())); |
|
|
|
->willThrowException(new InvalidTokenException()); |
|
|
|
|
|
|
|
|
|
|
|
$managerMethods = get_class_methods(Manager::class); |
|
|
|
$managerMethods = get_class_methods(Manager::class); |
|
|
|
//keep following methods intact in order to ensure hooks are working |
|
|
|
//keep following methods intact in order to ensure hooks are working |
|
|
@ -298,7 +298,7 @@ class SessionTest extends \Test\TestCase { |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
->method('getToken') |
|
|
|
->method('getToken') |
|
|
|
->with('bar') |
|
|
|
->with('bar') |
|
|
|
->will($this->throwException(new InvalidTokenException())); |
|
|
|
->willThrowException(new InvalidTokenException()); |
|
|
|
|
|
|
|
|
|
|
|
$user->expects($this->never()) |
|
|
|
$user->expects($this->never()) |
|
|
|
->method('isEnabled'); |
|
|
|
->method('isEnabled'); |
|
|
@ -404,7 +404,7 @@ class SessionTest extends \Test\TestCase { |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
->method('getToken') |
|
|
|
->method('getToken') |
|
|
|
->with('bar') |
|
|
|
->with('bar') |
|
|
|
->will($this->throwException(new InvalidTokenException())); |
|
|
|
->willThrowException(new InvalidTokenException()); |
|
|
|
|
|
|
|
|
|
|
|
$manager->expects($this->once()) |
|
|
|
$manager->expects($this->once()) |
|
|
|
->method('checkPasswordNoLogging') |
|
|
|
->method('checkPasswordNoLogging') |
|
|
@ -430,7 +430,7 @@ class SessionTest extends \Test\TestCase { |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
->method('getToken') |
|
|
|
->method('getToken') |
|
|
|
->with('doe') |
|
|
|
->with('doe') |
|
|
|
->will($this->throwException(new InvalidTokenException())); |
|
|
|
->willThrowException(new InvalidTokenException()); |
|
|
|
$this->config->expects($this->once()) |
|
|
|
$this->config->expects($this->once()) |
|
|
|
->method('getSystemValueBool') |
|
|
|
->method('getSystemValueBool') |
|
|
|
->with('token_auth_enforced', false) |
|
|
|
->with('token_auth_enforced', false) |
|
|
@ -466,7 +466,7 @@ class SessionTest extends \Test\TestCase { |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
->method('getToken') |
|
|
|
->method('getToken') |
|
|
|
->with('doe') |
|
|
|
->with('doe') |
|
|
|
->will($this->throwException(new InvalidTokenException())); |
|
|
|
->willThrowException(new InvalidTokenException()); |
|
|
|
$this->config->expects($this->once()) |
|
|
|
$this->config->expects($this->once()) |
|
|
|
->method('getSystemValueBool') |
|
|
|
->method('getSystemValueBool') |
|
|
|
->with('token_auth_enforced', false) |
|
|
|
->with('token_auth_enforced', false) |
|
|
@ -534,7 +534,7 @@ class SessionTest extends \Test\TestCase { |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
->method('getToken') |
|
|
|
->method('getToken') |
|
|
|
->with('doe') |
|
|
|
->with('doe') |
|
|
|
->will($this->throwException(new InvalidTokenException())); |
|
|
|
->willThrowException(new InvalidTokenException()); |
|
|
|
$this->config->expects($this->once()) |
|
|
|
$this->config->expects($this->once()) |
|
|
|
->method('getSystemValueBool') |
|
|
|
->method('getSystemValueBool') |
|
|
|
->with('token_auth_enforced', false) |
|
|
|
->with('token_auth_enforced', false) |
|
|
@ -788,7 +788,7 @@ class SessionTest extends \Test\TestCase { |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
->method('renewSessionToken') |
|
|
|
->method('renewSessionToken') |
|
|
|
->with($oldSessionId, $sessionId) |
|
|
|
->with($oldSessionId, $sessionId) |
|
|
|
->will($this->throwException(new InvalidTokenException())); |
|
|
|
->willThrowException(new InvalidTokenException()); |
|
|
|
|
|
|
|
|
|
|
|
$user->expects($this->never()) |
|
|
|
$user->expects($this->never()) |
|
|
|
->method('getUID') |
|
|
|
->method('getUID') |
|
|
@ -972,7 +972,7 @@ class SessionTest extends \Test\TestCase { |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
->method('getToken') |
|
|
|
->method('getToken') |
|
|
|
->with($password) |
|
|
|
->with($password) |
|
|
|
->will($this->throwException(new InvalidTokenException())); |
|
|
|
->willThrowException(new InvalidTokenException()); |
|
|
|
|
|
|
|
|
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
->method('generateToken') |
|
|
|
->method('generateToken') |
|
|
@ -1013,7 +1013,7 @@ class SessionTest extends \Test\TestCase { |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
->method('getToken') |
|
|
|
->method('getToken') |
|
|
|
->with($password) |
|
|
|
->with($password) |
|
|
|
->will($this->throwException(new InvalidTokenException())); |
|
|
|
->willThrowException(new InvalidTokenException()); |
|
|
|
|
|
|
|
|
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
$this->tokenProvider->expects($this->once()) |
|
|
|
->method('generateToken') |
|
|
|
->method('generateToken') |
|
|
|