summaryrefslogtreecommitdiffstats
path: root/tests/Core/Controller/TwoFactorChallengeControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Core/Controller/TwoFactorChallengeControllerTest.php')
-rw-r--r--tests/Core/Controller/TwoFactorChallengeControllerTest.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/tests/Core/Controller/TwoFactorChallengeControllerTest.php b/tests/Core/Controller/TwoFactorChallengeControllerTest.php
index 2da6dcd52ac..08d8dd1452c 100644
--- a/tests/Core/Controller/TwoFactorChallengeControllerTest.php
+++ b/tests/Core/Controller/TwoFactorChallengeControllerTest.php
@@ -33,7 +33,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
private $session;
private $urlGenerator;
- /** TwoFactorChallengeController */
+ /** @var TwoFactorChallengeController|\PHPUnit_Framework_MockObject_MockObject */
private $controller;
protected function setUp() {
@@ -47,9 +47,20 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->session = $this->getMock('\OCP\ISession');
$this->urlGenerator = $this->getMock('\OCP\IURLGenerator');
- $this->controller = new TwoFactorChallengeController(
- 'core', $this->request, $this->twoFactorManager, $this->userSession, $this->session, $this->urlGenerator
- );
+ $this->controller = $this->getMockBuilder('OC\Core\Controller\TwoFactorChallengeController')
+ ->setConstructorArgs([
+ 'core',
+ $this->request,
+ $this->twoFactorManager,
+ $this->userSession,
+ $this->session,
+ $this->urlGenerator,
+ ])
+ ->setMethods(['getLogoutAttribute'])
+ ->getMock();
+ $this->controller->expects($this->any())
+ ->method('getLogoutAttribute')
+ ->willReturn('logoutAttribute');
}
public function testSelectChallenge() {
@@ -70,6 +81,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$expected = new \OCP\AppFramework\Http\TemplateResponse('core', 'twofactorselectchallenge', [
'providers' => $providers,
'redirect_url' => '/some/url',
+ 'logout_attribute' => 'logoutAttribute',
], 'guest');
$this->assertEquals($expected, $this->controller->selectChallenge('/some/url'));
@@ -110,6 +122,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$expected = new \OCP\AppFramework\Http\TemplateResponse('core', 'twofactorshowchallenge', [
'error' => true,
'provider' => $provider,
+ 'logout_attribute' => 'logoutAttribute',
'template' => '<html/>',
], 'guest');