aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDaoTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDaoTest.php')
-rw-r--r--tests/lib/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDaoTest.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/lib/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDaoTest.php b/tests/lib/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDaoTest.php
index 56acba46ef0..b59ef876ffd 100644
--- a/tests/lib/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDaoTest.php
+++ b/tests/lib/Authentication/TwoFactorAuth/Db/ProviderUserAssignmentDaoTest.php
@@ -9,9 +9,9 @@ declare(strict_types=1);
namespace Test\Authentication\TwoFactorAuth\Db;
-use OC;
use OC\Authentication\TwoFactorAuth\Db\ProviderUserAssignmentDao;
use OCP\IDBConnection;
+use OCP\Server;
use Test\TestCase;
/**
@@ -27,7 +27,7 @@ class ProviderUserAssignmentDaoTest extends TestCase {
protected function setUp(): void {
parent::setUp();
- $this->dbConn = OC::$server->getDatabaseConnection();
+ $this->dbConn = Server::get(IDBConnection::class);
$qb = $this->dbConn->getQueryBuilder();
$q = $qb->delete(ProviderUserAssignmentDao::TABLE_NAME);
$q->execute();
@@ -35,7 +35,7 @@ class ProviderUserAssignmentDaoTest extends TestCase {
$this->dao = new ProviderUserAssignmentDao($this->dbConn);
}
- public function testGetState() {
+ public function testGetState(): void {
$qb = $this->dbConn->getQueryBuilder();
$q1 = $qb->insert(ProviderUserAssignmentDao::TABLE_NAME)->values([
'provider_id' => $qb->createNamedParameter('twofactor_u2f'),
@@ -59,7 +59,7 @@ class ProviderUserAssignmentDaoTest extends TestCase {
$this->assertEquals($expected, $state);
}
- public function testPersist() {
+ public function testPersist(): void {
$qb = $this->dbConn->getQueryBuilder();
$this->dao->persist('twofactor_totp', 'user123', 0);
@@ -76,7 +76,7 @@ class ProviderUserAssignmentDaoTest extends TestCase {
$this->assertCount(1, $data);
}
- public function testPersistTwice() {
+ public function testPersistTwice(): void {
$qb = $this->dbConn->getQueryBuilder();
$this->dao->persist('twofactor_totp', 'user123', 0);
@@ -95,7 +95,7 @@ class ProviderUserAssignmentDaoTest extends TestCase {
$this->assertCount(1, $data);
}
- public function testPersistSameStateTwice() {
+ public function testPersistSameStateTwice(): void {
$qb = $this->dbConn->getQueryBuilder();
$this->dao->persist('twofactor_totp', 'user123', 1);
@@ -114,7 +114,7 @@ class ProviderUserAssignmentDaoTest extends TestCase {
$this->assertCount(1, $data);
}
- public function testDeleteByUser() {
+ public function testDeleteByUser(): void {
$this->dao->persist('twofactor_fail', 'user1', 1);
$this->dao->persist('twofactor_u2f', 'user1', 1);
$this->dao->persist('twofactor_fail', 'user2', 0);
@@ -143,7 +143,7 @@ class ProviderUserAssignmentDaoTest extends TestCase {
$this->assertCount(2, $statesUser2);
}
- public function testDeleteAll() {
+ public function testDeleteAll(): void {
$this->dao->persist('twofactor_fail', 'user1', 1);
$this->dao->persist('twofactor_u2f', 'user1', 1);
$this->dao->persist('twofactor_fail', 'user2', 0);