summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2022-05-16 11:20:46 +0200
committerGitHub <noreply@github.com>2022-05-16 11:20:46 +0200
commitfd576b568cdfba3f64a35b5bc57a16141f234899 (patch)
tree69038065b025dab436895430c541fe412177c6dc /tests
parent6084d691b02764f32641aa41ebeacea5a0147b75 (diff)
parent7b3e2217de10c5b9b5b24edf1ae89ea95407ba4b (diff)
downloadnextcloud-server-fd576b568cdfba3f64a35b5bc57a16141f234899.tar.gz
nextcloud-server-fd576b568cdfba3f64a35b5bc57a16141f234899.zip
Merge pull request #32305 from nextcloud/bugfix/32302/fix-browser-agent-trimming
Fix user agent trimming on installation
Diffstat (limited to 'tests')
-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() {