diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-06-08 10:27:21 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-06-08 10:27:21 +0200 |
commit | 7dcc47dc94c2db2e1968b9a5bdcab694d1b78dbb (patch) | |
tree | 21bad607f43497f4906fa6961baa4d4a1c406c90 /tests | |
parent | b3592ab8067931bf63c5edcb26a684f3b235aa94 (diff) | |
parent | 3e3b326c85d31f69cbc30aa8b9aaa65d4ce04087 (diff) | |
download | nextcloud-server-7dcc47dc94c2db2e1968b9a5bdcab694d1b78dbb.tar.gz nextcloud-server-7dcc47dc94c2db2e1968b9a5bdcab694d1b78dbb.zip |
Merge pull request #25011 from owncloud/issue-24745-allow-to-cancel-2fa
Allow to cancel 2FA after login
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Core/Controller/TwoFactorChallengeControllerTest.php | 21 |
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'); |