diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-10-08 11:01:53 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-10-09 10:10:37 +0200 |
commit | 5122629bb0ff59a1688029d65e919ce31db8eced (patch) | |
tree | 367a89874edd75bc63c89fc0812a49ab5a9a64bc /tests | |
parent | f663154adfb81848295bbb6ddcc7ac9582c3a475 (diff) | |
download | nextcloud-server-5122629bb0ff59a1688029d65e919ce31db8eced.tar.gz nextcloud-server-5122629bb0ff59a1688029d65e919ce31db8eced.zip |
Make renewSessionToken return the new token
Avoids directly getting the token again. We just inserted it so it and
have all the info. So that query is just a waste.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/User/SessionTest.php | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/lib/User/SessionTest.php b/tests/lib/User/SessionTest.php index 63497ac35de..d6e0263da52 100644 --- a/tests/lib/User/SessionTest.php +++ b/tests/lib/User/SessionTest.php @@ -595,25 +595,24 @@ class SessionTest extends \Test\TestCase { ->method('setUserValue') ->with('foo', 'login_token', 'abcdefg123456', 10000); - $session->expects($this->once()) - ->method('getId') - ->will($this->returnValue($sessionId)); - $this->tokenProvider->expects($this->once()) - ->method('renewSessionToken') - ->with($oldSessionId, $sessionId) - ->will($this->returnValue(true)); - $tokenObject = $this->createMock(IToken::class); $tokenObject->expects($this->once()) ->method('getLoginName') ->willReturn('foobar'); $tokenObject->method('getId') ->willReturn(42); + + $session->expects($this->once()) + ->method('getId') + ->will($this->returnValue($sessionId)); $this->tokenProvider->expects($this->once()) - ->method('getToken') - ->with($sessionId) + ->method('renewSessionToken') + ->with($oldSessionId, $sessionId) ->willReturn($tokenObject); + $this->tokenProvider->expects($this->never()) + ->method('getToken'); + $user->expects($this->any()) ->method('getUID') ->will($this->returnValue('foo')); |