aboutsummaryrefslogtreecommitdiffstats
path: root/apps/twofactor_backupcodes/tests
diff options
context:
space:
mode:
Diffstat (limited to 'apps/twofactor_backupcodes/tests')
-rw-r--r--apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php8
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php4
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php22
-rw-r--r--apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php8
4 files changed, 20 insertions, 22 deletions
diff --git a/apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php b/apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php
index 38d3bd55d11..cfc35e7cb1c 100644
--- a/apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php
+++ b/apps/twofactor_backupcodes/tests/Service/BackupCodeStorageTest.php
@@ -44,10 +44,10 @@ class BackupCodeStorageTest extends TestCase {
$this->notificationManager->expects($this->once())
->method('markProcessed')
->with($this->callback(function (INotification $notification) {
- return $notification->getUser() === $this->testUID &&
- $notification->getObjectType() === 'create' &&
- $notification->getObjectId() === 'codes' &&
- $notification->getApp() === 'twofactor_backupcodes';
+ return $notification->getUser() === $this->testUID
+ && $notification->getObjectType() === 'create'
+ && $notification->getObjectId() === 'codes'
+ && $notification->getApp() === 'twofactor_backupcodes';
}));
// Create codes
diff --git a/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php b/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php
index a3c6d15902a..152ff80194a 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Activity/ProviderTest.php
@@ -51,9 +51,7 @@ class ProviderTest extends TestCase {
];
}
- /**
- * @dataProvider subjectData
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('subjectData')]
public function testParse(string $subject): void {
$lang = 'ru';
$event = $this->createMock(IEvent::class);
diff --git a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php
index 16a0e8012f7..6b162894258 100644
--- a/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/BackgroundJob/RememberBackupCodesJobTest.php
@@ -154,12 +154,12 @@ class RememberBackupCodesJobTest extends TestCase {
$this->notificationManager->expects($this->once())
->method('notify')
->with($this->callback(function (INotification $n) {
- return $n->getApp() === 'twofactor_backupcodes' &&
- $n->getUser() === 'validUID' &&
- $n->getDateTime()->getTimestamp() === 10000000 &&
- $n->getObjectType() === 'create' &&
- $n->getObjectId() === 'codes' &&
- $n->getSubject() === 'create_backupcodes';
+ return $n->getApp() === 'twofactor_backupcodes'
+ && $n->getUser() === 'validUID'
+ && $n->getDateTime()->getTimestamp() === 10000000
+ && $n->getObjectType() === 'create'
+ && $n->getObjectId() === 'codes'
+ && $n->getSubject() === 'create_backupcodes';
}));
self::invokePrivate($this->job, 'run', [['uid' => 'validUID']]);
@@ -198,11 +198,11 @@ class RememberBackupCodesJobTest extends TestCase {
$this->notificationManager->expects($this->once())
->method('markProcessed')
->with($this->callback(function (INotification $n) {
- return $n->getApp() === 'twofactor_backupcodes' &&
- $n->getUser() === 'validUID' &&
- $n->getObjectType() === 'create' &&
- $n->getObjectId() === 'codes' &&
- $n->getSubject() === 'create_backupcodes';
+ return $n->getApp() === 'twofactor_backupcodes'
+ && $n->getUser() === 'validUID'
+ && $n->getObjectType() === 'create'
+ && $n->getObjectId() === 'codes'
+ && $n->getSubject() === 'create_backupcodes';
}));
$this->notificationManager->expects($this->never())
diff --git a/apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php b/apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php
index fc80344ac57..229d8df05d3 100644
--- a/apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php
+++ b/apps/twofactor_backupcodes/tests/Unit/Listener/ClearNotificationsTest.php
@@ -48,10 +48,10 @@ class ClearNotificationsTest extends TestCase {
$this->notificationManager->expects($this->once())
->method('markProcessed')
->with($this->callback(function (INotification $n) {
- return $n->getUser() === 'fritz' &&
- $n->getApp() === 'twofactor_backupcodes' &&
- $n->getObjectType() === 'create' &&
- $n->getObjectId() === 'codes';
+ return $n->getUser() === 'fritz'
+ && $n->getApp() === 'twofactor_backupcodes'
+ && $n->getObjectType() === 'create'
+ && $n->getObjectId() === 'codes';
}));
$this->listener->handle($event);