diff options
author | Joas Schilling <coding@schilljs.com> | 2025-05-02 14:00:10 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2025-05-02 16:47:42 +0200 |
commit | c24f5fb256f53836727d3479e0fcf79d680ca2ca (patch) | |
tree | 97e2ee14c40ed1cf2237eacd26f69375235e8419 /tests/Core/Controller/TwoFactorChallengeControllerTest.php | |
parent | 9a16e4fd1407f0490136f6cfeec184be4b219dce (diff) | |
download | nextcloud-server-test/noid/more-phpunit-10.tar.gz nextcloud-server-test/noid/more-phpunit-10.zip |
test: Finish migrating tests/Core/ to PHPUnit 10 compatible codetest/noid/more-phpunit-10
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/Core/Controller/TwoFactorChallengeControllerTest.php')
-rw-r--r-- | tests/Core/Controller/TwoFactorChallengeControllerTest.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/Core/Controller/TwoFactorChallengeControllerTest.php b/tests/Core/Controller/TwoFactorChallengeControllerTest.php index 7498abb9a9e..97900191199 100644 --- a/tests/Core/Controller/TwoFactorChallengeControllerTest.php +++ b/tests/Core/Controller/TwoFactorChallengeControllerTest.php @@ -68,7 +68,7 @@ class TwoFactorChallengeControllerTest extends TestCase { $this->urlGenerator, $this->logger, ]) - ->setMethods(['getLogoutUrl']) + ->onlyMethods(['getLogoutUrl']) ->getMock(); $this->controller->expects($this->any()) ->method('getLogoutUrl') @@ -302,12 +302,16 @@ class TwoFactorChallengeControllerTest extends TestCase { ->method('verifyChallenge') ->with('myprovider', $user, 'token') ->will($this->throwException($exception)); + $calls = [ + ['two_factor_auth_error_message', '2FA failed'], + ['two_factor_auth_error', true], + ]; $this->session->expects($this->exactly(2)) ->method('set') - ->withConsecutive( - ['two_factor_auth_error_message', '2FA failed'], - ['two_factor_auth_error', true] - ); + ->willReturnCallback(function () use (&$calls) { + $expected = array_shift($calls); + $this->assertEquals($expected, func_get_args()); + }); $this->urlGenerator->expects($this->once()) ->method('linkToRoute') ->with('core.TwoFactorChallenge.showChallenge', [ |