diff options
Diffstat (limited to 'tests/lib/Authentication/Token/DefaultTokenMapperTest.php')
-rw-r--r-- | tests/lib/Authentication/Token/DefaultTokenMapperTest.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/lib/Authentication/Token/DefaultTokenMapperTest.php b/tests/lib/Authentication/Token/DefaultTokenMapperTest.php index fb20558c95a..7060dc2a770 100644 --- a/tests/lib/Authentication/Token/DefaultTokenMapperTest.php +++ b/tests/lib/Authentication/Token/DefaultTokenMapperTest.php @@ -145,10 +145,10 @@ class DefaultTokenMapperTest 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); @@ -175,17 +175,17 @@ class DefaultTokenMapperTest 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); |