aboutsummaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-01-30 10:44:43 +0100
committerCôme Chilliet <91878298+come-nc@users.noreply.github.com>2024-01-30 10:57:15 +0100
commit0dd00351d4d16d4a1bf717b2b6488ce8f025918c (patch)
tree17186724f7f6135080b5e337af08bdd90574d1d9 /apps/twofactor_backupcodes
parent220296b216e8cdb139c278fd77a251e30875cc1e (diff)
downloadnextcloud-server-0dd00351d4d16d4a1bf717b2b6488ce8f025918c.tar.gz
nextcloud-server-0dd00351d4d16d4a1bf717b2b6488ce8f025918c.zip
chore: Fix twofactor_backupcodes tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/twofactor_backupcodes')
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php18
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php18
2 files changed, 12 insertions, 24 deletions
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php
index 659b16676b0..4ebd94d96bd 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderDisabledTest.php
@@ -29,22 +29,16 @@ namespace OCA\TwoFactorBackupCodes\Tests\Unit\Listener;
use OCA\TwoFactorBackupCodes\BackgroundJob\RememberBackupCodesJob;
use OCA\TwoFactorBackupCodes\Listener\ProviderDisabled;
use OCP\Authentication\TwoFactorAuth\IRegistry;
-use OCP\Authentication\TwoFactorAuth\RegistryEvent;
+use OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserUnregistered;
use OCP\BackgroundJob\IJobList;
use OCP\EventDispatcher\Event;
use OCP\IUser;
use Test\TestCase;
class ProviderDisabledTest extends TestCase {
-
- /** @var IRegistry|\PHPUnit\Framework\MockObject\MockObject */
- private $registy;
-
- /** @var IJobList|\PHPUnit\Framework\MockObject\MockObject */
- private $jobList;
-
- /** @var ProviderDisabled */
- private $listener;
+ private IRegistry $registy;
+ private IJobList $jobList;
+ private ProviderDisabled $listener;
protected function setUp(): void {
parent::setUp();
@@ -67,7 +61,7 @@ class ProviderDisabledTest extends TestCase {
$user = $this->createMock(IUser::class);
$user->method('getUID')
->willReturn('myUID');
- $event = $this->createMock(RegistryEvent::class);
+ $event = $this->createMock(TwoFactorProviderForUserUnregistered::class);
$event->method('getUser')
->willReturn($user);
@@ -88,7 +82,7 @@ class ProviderDisabledTest extends TestCase {
$user = $this->createMock(IUser::class);
$user->method('getUID')
->willReturn('myUID');
- $event = $this->createMock(RegistryEvent::class);
+ $event = $this->createMock(TwoFactorProviderForUserUnregistered::class);
$event->method('getUser')
->willReturn($user);
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php
index d74fa6e259d..a85d6734a07 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/ProviderEnabledTest.php
@@ -29,22 +29,16 @@ namespace OCA\TwoFactorBackupCodes\Tests\Unit\Listener;
use OCA\TwoFactorBackupCodes\BackgroundJob\RememberBackupCodesJob;
use OCA\TwoFactorBackupCodes\Listener\ProviderEnabled;
use OCP\Authentication\TwoFactorAuth\IRegistry;
-use OCP\Authentication\TwoFactorAuth\RegistryEvent;
+use OCP\Authentication\TwoFactorAuth\TwoFactorProviderForUserRegistered;
use OCP\BackgroundJob\IJobList;
use OCP\EventDispatcher\Event;
use OCP\IUser;
use Test\TestCase;
class ProviderEnabledTest extends TestCase {
-
- /** @var IRegistry|\PHPUnit\Framework\MockObject\MockObject */
- private $registy;
-
- /** @var IJobList|\PHPUnit\Framework\MockObject\MockObject */
- private $jobList;
-
- /** @var ProviderEnabled */
- private $listener;
+ private IRegistry $registy;
+ private IJobList $jobList;
+ private ProviderEnabled $listener;
protected function setUp(): void {
parent::setUp();
@@ -67,7 +61,7 @@ class ProviderEnabledTest extends TestCase {
$user = $this->createMock(IUser::class);
$user->method('getUID')
->willReturn('myUID');
- $event = $this->createMock(RegistryEvent::class);
+ $event = $this->createMock(TwoFactorProviderForUserRegistered::class);
$event->method('getUser')
->willReturn($user);
@@ -87,7 +81,7 @@ class ProviderEnabledTest extends TestCase {
$user = $this->createMock(IUser::class);
$user->method('getUID')
->willReturn('myUID');
- $event = $this->createMock(RegistryEvent::class);
+ $event = $this->createMock(TwoFactorProviderForUserRegistered::class);
$event->method('getUser')
->willReturn($user);