aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Authentication/Token/DefaultTokenMapperTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Authentication/Token/DefaultTokenMapperTest.php')
-rw-r--r--tests/lib/Authentication/Token/DefaultTokenMapperTest.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/lib/Authentication/Token/DefaultTokenMapperTest.php b/tests/lib/Authentication/Token/DefaultTokenMapperTest.php
index a40db4461d2..7060dc2a770 100644
--- a/tests/lib/Authentication/Token/DefaultTokenMapperTest.php
+++ b/tests/lib/Authentication/Token/DefaultTokenMapperTest.php
@@ -46,7 +46,7 @@ class DefaultTokenMapperTest extends TestCase {
private $dbConnection;
private $time;
- protected function setUp() {
+ protected function setUp(): void {
parent::setUp();
$this->dbConnection = OC::$server->getDatabaseConnection();
@@ -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);