diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-27 15:27:18 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-11-27 15:27:18 +0100 |
commit | 3a7cf40aaa678bea1df143d2982d603b7a334eec (patch) | |
tree | 63c1e3ad7f7f401d14411a4d44c523632906afc9 /tests/lib/Authentication/Token/PublicKeyTokenProviderTest.php | |
parent | 0568b012672d650c6b5a49e72c4028dde5463c60 (diff) | |
download | nextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.tar.gz nextcloud-server-3a7cf40aaa678bea1df143d2982d603b7a334eec.zip |
Mode to modern phpunit
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
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'; |