summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-12-13 14:41:56 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2018-01-02 20:30:37 +0100
commit1bcbeb24bcb82f825d1993217cdb6878375c5077 (patch)
tree83b171423eb459f92fd0ecbf926ee09864b5996a /tests
parent7fdd9097bb8cfa4a5d3afe161e1ee2a71da3a8eb (diff)
downloadnextcloud-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.php11
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
);
}