diff options
Diffstat (limited to 'tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php')
-rw-r--r-- | tests/lib/Authentication/Token/PublicKeyTokenMapperTest.php | 18 |
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); |