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
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Authentication/Token/DefaultTokenProviderTest.php')
-rw-r--r--tests/lib/Authentication/Token/DefaultTokenProviderTest.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php
index b90a9931937..b4e5e097847 100644
--- a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php
+++ b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php
@@ -159,10 +159,10 @@ class DefaultTokenProviderTest extends TestCase {
$this->assertEquals('passme', $actual);
}
- /**
- * @expectedException \OC\Authentication\Exceptions\PasswordlessTokenException
- */
+
public function testGetPasswordPasswordLessToken() {
+ $this->expectException(\OC\Authentication\Exceptions\PasswordlessTokenException::class);
+
$token = 'token1234';
$tk = new DefaultToken();
$tk->setPassword(null);
@@ -170,10 +170,10 @@ class DefaultTokenProviderTest extends TestCase {
$this->tokenProvider->getPassword($tk, $token);
}
- /**
- * @expectedException \OC\Authentication\Exceptions\InvalidTokenException
- */
+
public function testGetPasswordDeletesInvalidToken() {
+ $this->expectException(\OC\Authentication\Exceptions\InvalidTokenException::class);
+
$token = 'token1234';
$tk = new DefaultToken();
$tk->setPassword('someencryptedvalue');
@@ -222,10 +222,10 @@ class DefaultTokenProviderTest extends TestCase {
$this->assertEquals('encryptedpassword', $token->getPassword());
}
- /**
- * @expectedException \OC\Authentication\Exceptions\InvalidTokenException
- */
+
public function testSetPasswordInvalidToken() {
+ $this->expectException(\OC\Authentication\Exceptions\InvalidTokenException::class);
+
$token = $this->createMock(IToken::class);
$tokenId = 'token123';
$password = '123456';