aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_status/tests/Unit/Db/UserStatusMapperTest.php')
-rw-r--r--apps/user_status/tests/Unit/Db/UserStatusMapperTest.php24
1 files changed, 5 insertions, 19 deletions
diff --git a/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php b/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
index 46147c6a822..ea4480489c7 100644
--- a/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
+++ b/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
@@ -15,9 +15,7 @@ use OCP\DB\Exception;
use Test\TestCase;
class UserStatusMapperTest extends TestCase {
-
- /** @var UserStatusMapper */
- private $mapper;
+ private UserStatusMapper $mapper;
protected function setUp(): void {
parent::setUp();
@@ -136,14 +134,7 @@ class UserStatusMapperTest extends TestCase {
$this->mapper->insert($userStatus2);
}
- /**
- * @param string $status
- * @param bool $isUserDefined
- * @param int $timestamp
- * @param bool $expectsClean
- *
- * @dataProvider clearStatusesOlderThanDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('clearStatusesOlderThanDataProvider')]
public function testClearStatusesOlderThan(string $status, bool $isUserDefined, int $timestamp, bool $expectsClean): void {
$oldStatus = UserStatus::fromParams([
'userId' => 'john.doe',
@@ -169,7 +160,7 @@ class UserStatusMapperTest extends TestCase {
}
}
- public function clearStatusesOlderThanDataProvider(): array {
+ public static function clearStatusesOlderThanDataProvider(): array {
return [
['offline', false, 6000, false],
['online', true, 6000, false],
@@ -231,7 +222,7 @@ class UserStatusMapperTest extends TestCase {
$this->mapper->insert($userStatus3);
}
- public function dataCreateBackupStatus(): array {
+ public static function dataCreateBackupStatus(): array {
return [
[false, false, false],
[true, false, true],
@@ -240,12 +231,7 @@ class UserStatusMapperTest extends TestCase {
];
}
- /**
- * @dataProvider dataCreateBackupStatus
- * @param bool $hasStatus
- * @param bool $hasBackup
- * @param bool $backupCreated
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataCreateBackupStatus')]
public function testCreateBackupStatus(bool $hasStatus, bool $hasBackup, bool $backupCreated): void {
if ($hasStatus) {
$userStatus1 = new UserStatus();