aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-05-09 08:36:34 +0200
committerJoas Schilling <coding@schilljs.com>2022-05-09 08:36:34 +0200
commit7b3e2217de10c5b9b5b24edf1ae89ea95407ba4b (patch)
treeb7fb9ffd333d403771d0f7209e1a4ec3e744076a /tests/lib
parent4f55ba2a8895995649306911e3efa92904906836 (diff)
downloadnextcloud-server-7b3e2217de10c5b9b5b24edf1ae89ea95407ba4b.tar.gz
nextcloud-server-7b3e2217de10c5b9b5b24edf1ae89ea95407ba4b.zip
Fix user agent trimming on installation
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
index f6067b8d15a..6ad57515c16 100644
--- a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
+++ b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
@@ -94,8 +94,6 @@ class PublicKeyTokenProviderTest extends TestCase {
}
public function testGenerateTokenInvalidName() {
- $this->expectException(\OC\Authentication\Exceptions\InvalidTokenException::class);
-
$token = 'token';
$uid = 'user';
$user = 'User';
@@ -107,6 +105,13 @@ class PublicKeyTokenProviderTest extends TestCase {
$type = IToken::PERMANENT_TOKEN;
$actual = $this->tokenProvider->generateToken($token, $uid, $user, $password, $name, $type, IToken::DO_NOT_REMEMBER);
+
+ $this->assertInstanceOf(PublicKeyToken::class, $actual);
+ $this->assertSame($uid, $actual->getUID());
+ $this->assertSame($user, $actual->getLoginName());
+ $this->assertSame('User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12User-Agent: Mozill…', $actual->getName());
+ $this->assertSame(IToken::DO_NOT_REMEMBER, $actual->getRemember());
+ $this->assertSame($password, $this->tokenProvider->getPassword($actual, $token));
}
public function testUpdateToken() {