aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 15:27:18 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-11-27 15:27:18 +0100
commit3a7cf40aaa678bea1df143d2982d603b7a334eec (patch)
tree63c1e3ad7f7f401d14411a4d44c523632906afc9 /tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php
parent0568b012672d650c6b5a49e72c4028dde5463c60 (diff)
downloadnextcloud-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/PublicKeyTokenMapperTest.php')
-rw-r--r--tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php b/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php
index b58001ee7bb..58340b905c0 100644
--- a/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php
+++ b/tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php
@@ -171,10 +171,10 @@ class PublicKeyTokenMapperTest extends TestCase {
$this->assertEquals($token, $dbToken);
}
- /**
- * @expectedException \OCP\AppFramework\Db\DoesNotExistException
- */
+
public function testGetInvalidToken() {
+ $this->expectException(\OCP\AppFramework\Db\DoesNotExistException::class);
+
$token = 'thisisaninvalidtokenthatisnotinthedatabase';
$this->mapper->getToken($token);
@@ -203,17 +203,17 @@ class PublicKeyTokenMapperTest extends TestCase {
$this->assertEquals($token, $dbToken);
}
- /**
- * @expectedException \OCP\AppFramework\Db\DoesNotExistException
- */
+
public function testGetTokenByIdNotFound() {
+ $this->expectException(\OCP\AppFramework\Db\DoesNotExistException::class);
+
$this->mapper->getTokenById(-1);
}
- /**
- * @expectedException \OCP\AppFramework\Db\DoesNotExistException
- */
+
public function testGetInvalidTokenById() {
+ $this->expectException(\OCP\AppFramework\Db\DoesNotExistException::class);
+
$id = '42';
$this->mapper->getToken($id);