summaryrefslogtreecommitdiffstats
path: root/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-12-01 22:17:19 +0100
committerJoas Schilling <coding@schilljs.com>2021-12-01 22:17:19 +0100
commitc6ae53096c36e6a475467eaeb6df00ac8d38e4b2 (patch)
tree80deaa0d05a26564937a03d430197d1f6a57d30b /tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
parent9f001790379829096939015e790f0a35b6a38787 (diff)
downloadnextcloud-server-c6ae53096c36e6a475467eaeb6df00ac8d38e4b2.tar.gz
nextcloud-server-c6ae53096c36e6a475467eaeb6df00ac8d38e4b2.zip
More test fixing
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php')
-rw-r--r--tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php33
1 files changed, 1 insertions, 32 deletions
diff --git a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
index 486660f17c6..6d18c22ca07 100644
--- a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
+++ b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
@@ -476,39 +476,8 @@ class PublicKeyTokenProviderTest extends TestCase {
$this->assertNull($new->getPassword());
}
- public function testConvertToken() {
- $defaultToken = new DefaultToken();
- $defaultToken->setId(42);
- $defaultToken->setPassword('oldPass');
- $defaultToken->setExpires(1337);
- $defaultToken->setToken('oldToken');
- $defaultToken->setUid('uid');
- $defaultToken->setLoginName('loginName');
- $defaultToken->setLastActivity(999);
- $defaultToken->setName('name');
- $defaultToken->setRemember(IToken::REMEMBER);
- $defaultToken->setType(IToken::PERMANENT_TOKEN);
-
- $this->mapper->expects($this->once())
- ->method('update')
- ->willReturnArgument(0);
-
- $newToken = $this->tokenProvider->convertToken($defaultToken, 'newToken', 'newPassword');
-
- $this->assertSame(42, $newToken->getId());
- $this->assertSame('newPassword', $this->tokenProvider->getPassword($newToken, 'newToken'));
- $this->assertSame(1337, $newToken->getExpires());
- $this->assertSame('uid', $newToken->getUID());
- $this->assertSame('loginName', $newToken->getLoginName());
- $this->assertSame(1313131, $newToken->getLastActivity());
- $this->assertSame(1313131, $newToken->getLastCheck());
- $this->assertSame('name', $newToken->getName());
- $this->assertSame(IToken::REMEMBER, $newToken->getRemember());
- $this->assertSame(IToken::PERMANENT_TOKEN, $newToken->getType());
- }
-
public function testMarkPasswordInvalidInvalidToken() {
- $token = $this->createMock(DefaultToken::class);
+ $token = $this->createMock(IToken::class);
$this->expectException(InvalidTokenException::class);