diff options
Diffstat (limited to 'tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php')
-rw-r--r-- | tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php index aecbd969ee1..3fa7a92bb9b 100644 --- a/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php +++ b/tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php @@ -145,10 +145,10 @@ class PublicKeyTokenProviderTest extends TestCase { $this->assertSame($password, $this->tokenProvider->getPassword($actual, $token)); } - /** - * @expectedException \OC\Authentication\Exceptions\PasswordlessTokenException - */ + public function testGetPasswordPasswordLessToken() { + $this->expectException(\OC\Authentication\Exceptions\PasswordlessTokenException::class); + $token = 'token1234'; $tk = new PublicKeyToken(); $tk->setPassword(null); @@ -156,10 +156,10 @@ class PublicKeyTokenProviderTest extends TestCase { $this->tokenProvider->getPassword($tk, $token); } - /** - * @expectedException \OC\Authentication\Exceptions\InvalidTokenException - */ + public function testGetPasswordInvalidToken() { + $this->expectException(\OC\Authentication\Exceptions\InvalidTokenException::class); + $token = 'token'; $uid = 'user'; $user = 'User'; @@ -205,10 +205,10 @@ class PublicKeyTokenProviderTest extends TestCase { $this->assertSame($newpass, $this->tokenProvider->getPassword($actual, 'token')); } - /** - * @expectedException \OC\Authentication\Exceptions\InvalidTokenException - */ + public function testSetPasswordInvalidToken() { + $this->expectException(\OC\Authentication\Exceptions\InvalidTokenException::class); + $token = $this->createMock(IToken::class); $tokenId = 'token123'; $password = '123456'; |