diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2017-12-13 14:41:56 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-01-02 20:30:37 +0100 |
commit | 1bcbeb24bcb82f825d1993217cdb6878375c5077 (patch) | |
tree | 83b171423eb459f92fd0ecbf926ee09864b5996a /tests | |
parent | 7fdd9097bb8cfa4a5d3afe161e1ee2a71da3a8eb (diff) | |
download | nextcloud-server-1bcbeb24bcb82f825d1993217cdb6878375c5077.tar.gz nextcloud-server-1bcbeb24bcb82f825d1993217cdb6878375c5077.zip |
disable password confirmation with SSO
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php b/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php index 6b311c7ae15..411878fc8c5 100644 --- a/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php +++ b/tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php @@ -50,6 +50,8 @@ use OCP\INavigationManager; use OCP\IRequest; use OCP\ISession; use OCP\IURLGenerator; +use OCP\IUser; +use OCP\IUserSession; use OCP\Security\ISecureRandom; class SecurityMiddlewareTest extends \Test\TestCase { @@ -82,6 +84,8 @@ class SecurityMiddlewareTest extends \Test\TestCase { private $cspNonceManager; /** @var IAppManager|\PHPUnit_Framework_MockObject_MockObject */ private $appManager; + /** @var IUserSession|\PHPUnit_Framework_MockObject_MockObject */ + private $userSession; protected function setUp() { parent::setUp(); @@ -100,6 +104,10 @@ class SecurityMiddlewareTest extends \Test\TestCase { $this->appManager->expects($this->any()) ->method('isEnabledForUser') ->willReturn(true); + $this->userSession = $this->createMock(IUserSession::class); + $user = $this->createMock(IUser::class); + $user->expects($this->any())->method('getBackendClassName')->willReturn('user_ldap'); + $this->userSession->expects($this->any())->method('getUser')->willReturn($user); $this->middleware = $this->getMiddleware(true, true); $this->secException = new SecurityException('hey', false); $this->secAjaxException = new SecurityException('hey', true); @@ -124,7 +132,8 @@ class SecurityMiddlewareTest extends \Test\TestCase { $this->contentSecurityPolicyManager, $this->csrfTokenManager, $this->cspNonceManager, - $this->appManager + $this->appManager, + $this->userSession ); } |