Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-05-09 09:36:34 +0300
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-05-16 13:16:17 +0300
commit82ada01ad6ddedbdb45c42e1bf514689cac79bd0 (patch)
tree923512603f86a5eab1f045ef20340e0487707c8a /tests
parent032e64f730e46877b4bfa209c63cffd524bb4eaf (diff)
Fix user agent trimming on installation
Signed-off-by: Joas Schilling <coding@schilljs.com>
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 767e7897c58..a587944a930 100644
--- a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
+++ b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php
@@ -96,8 +96,6 @@ class PublicKeyTokenProviderTest extends TestCase {
}
public function testGenerateTokenInvalidName() {
- $this->expectException(\OC\Authentication\Exceptions\InvalidTokenException::class);
-
$token = 'token';
$uid = 'user';
$user = 'User';
@@ -109,6 +107,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() {