diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2025-06-12 15:14:20 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2025-06-12 15:27:28 +0200 |
commit | 8b733478e9e0fa07ff652db23a868ab685aab2e4 (patch) | |
tree | 6854dc979c8447d8b3d8e4bb6d2494f31f6fcf3a | |
parent | a205ae60082d30a1c7fa47611bb5fae73de14cd0 (diff) | |
download | nextcloud-server-debug/noid/log-reason-token-mismatch-stable31.tar.gz nextcloud-server-debug/noid/log-reason-token-mismatch-stable31.zip |
test(Unit): adjust test to debug code additionsdebug/noid/log-reason-token-mismatch-stable31
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r-- | tests/Core/Controller/ClientFlowLoginControllerTest.php | 14 | ||||
-rw-r--r-- | tests/Core/Controller/ClientFlowLoginV2ControllerTest.php | 6 |
2 files changed, 12 insertions, 8 deletions
diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php index 591a3027e96..5f2f90b3687 100644 --- a/tests/Core/Controller/ClientFlowLoginControllerTest.php +++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php @@ -139,10 +139,11 @@ class ClientFlowLoginControllerTest extends TestCase { ->method('set') ->with('client.flow.state.token', 'StateToken'); $this->session - ->expects($this->once()) ->method('get') - ->with('oauth.state') - ->willReturn('OauthStateToken'); + ->willReturnMap([ + ['client.flow.state.token', 'StateToken'], + ['oauth.state', 'OauthStateToken'], + ]); $this->defaults ->expects($this->once()) ->method('getName') @@ -210,10 +211,11 @@ class ClientFlowLoginControllerTest extends TestCase { ->method('set') ->with('client.flow.state.token', 'StateToken'); $this->session - ->expects($this->once()) ->method('get') - ->with('oauth.state') - ->willReturn('OauthStateToken'); + ->willReturnMap([ + ['client.flow.state.token', 'StateToken'], + ['oauth.state', 'OauthStateToken'], + ]); $this->defaults ->expects($this->once()) ->method('getName') diff --git a/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php b/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php index 98c7821791d..5f73a5a11f0 100644 --- a/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php +++ b/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php @@ -152,8 +152,10 @@ class ClientFlowLoginV2ControllerTest extends TestCase { public function testShowAuthPickerValidLoginToken(): void { $this->session->method('get') - ->with('client.flow.v2.login.token') - ->willReturn('loginToken'); + ->willReturnMap([ + ['client.flow.v2.state.token', 'random'], + ['client.flow.v2.login.token', 'loginToken'], + ]); $flow = new LoginFlowV2(); $this->loginFlowV2Service->method('getByLoginToken') |