aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_status/tests/Unit
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2025-07-02 18:30:40 +0200
committerGitHub <noreply@github.com>2025-07-02 18:30:40 +0200
commit2337bd84c2f420b1944c3c1f4739ac0cfea15ca4 (patch)
treef5f0a89bb926f42fbb3834b3191d4267feb14dfa /apps/user_status/tests/Unit
parent5d14f873752ce15d37f6fa987a3d0c51702f88df (diff)
parentaa15f9d16d5b46d04763c7deedb129990e819364 (diff)
downloadnextcloud-server-master.tar.gz
nextcloud-server-master.zip
Merge pull request #53728 from nextcloud/rector-phpunit10HEADmaster
chore/rector: make phpunit dataproviders phpunit 12 compatible
Diffstat (limited to 'apps/user_status/tests/Unit')
-rw-r--r--apps/user_status/tests/Unit/CapabilitiesTest.php4
-rw-r--r--apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php12
-rw-r--r--apps/user_status/tests/Unit/Db/UserStatusMapperTest.php8
-rw-r--r--apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php4
-rw-r--r--apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php12
-rw-r--r--apps/user_status/tests/Unit/Service/StatusServiceTest.php16
6 files changed, 14 insertions, 42 deletions
diff --git a/apps/user_status/tests/Unit/CapabilitiesTest.php b/apps/user_status/tests/Unit/CapabilitiesTest.php
index ef721eaa90b..f07892ff3fd 100644
--- a/apps/user_status/tests/Unit/CapabilitiesTest.php
+++ b/apps/user_status/tests/Unit/CapabilitiesTest.php
@@ -24,9 +24,7 @@ class CapabilitiesTest extends TestCase {
$this->capabilities = new Capabilities($this->emojiHelper);
}
- /**
- * @dataProvider getCapabilitiesDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('getCapabilitiesDataProvider')]
public function testGetCapabilities(bool $supportsEmojis): void {
$this->emojiHelper->expects($this->once())
->method('doesPlatformSupportEmoji')
diff --git a/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php b/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php
index 45ee9c4fdba..e99290319ed 100644
--- a/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php
+++ b/apps/user_status/tests/Unit/Controller/UserStatusControllerTest.php
@@ -87,9 +87,7 @@ class UserStatusControllerTest extends TestCase {
$this->controller->getStatus();
}
- /**
- * @dataProvider setStatusDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('setStatusDataProvider')]
public function testSetStatus(
string $statusType,
?string $statusIcon,
@@ -149,9 +147,7 @@ class UserStatusControllerTest extends TestCase {
];
}
- /**
- * @dataProvider setPredefinedMessageDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('setPredefinedMessageDataProvider')]
public function testSetPredefinedMessage(
string $messageId,
?int $clearAt,
@@ -211,9 +207,7 @@ class UserStatusControllerTest extends TestCase {
];
}
- /**
- * @dataProvider setCustomMessageDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('setCustomMessageDataProvider')]
public function testSetCustomMessage(
?string $statusIcon,
string $message,
diff --git a/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php b/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
index c9bda492210..ea4480489c7 100644
--- a/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
+++ b/apps/user_status/tests/Unit/Db/UserStatusMapperTest.php
@@ -134,9 +134,7 @@ class UserStatusMapperTest extends TestCase {
$this->mapper->insert($userStatus2);
}
- /**
- * @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',
@@ -233,9 +231,7 @@ class UserStatusMapperTest extends TestCase {
];
}
- /**
- * @dataProvider dataCreateBackupStatus
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataCreateBackupStatus')]
public function testCreateBackupStatus(bool $hasStatus, bool $hasBackup, bool $backupCreated): void {
if ($hasStatus) {
$userStatus1 = new UserStatus();
diff --git a/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php b/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php
index c94315a7a93..c03eed0089e 100644
--- a/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php
+++ b/apps/user_status/tests/Unit/Listener/UserLiveStatusListenerTest.php
@@ -49,9 +49,7 @@ class UserLiveStatusListenerTest extends TestCase {
);
}
- /**
- * @dataProvider handleEventWithCorrectEventDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('handleEventWithCorrectEventDataProvider')]
public function testHandleWithCorrectEvent(
string $userId,
string $previousStatus,
diff --git a/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php b/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php
index 091466637f0..de5d92055f1 100644
--- a/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php
+++ b/apps/user_status/tests/Unit/Service/PredefinedStatusServiceTest.php
@@ -93,9 +93,7 @@ class PredefinedStatusServiceTest extends TestCase {
], $actual);
}
- /**
- * @dataProvider getIconForIdDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('getIconForIdDataProvider')]
public function testGetIconForId(string $id, ?string $expectedIcon): void {
$actual = $this->service->getIconForId($id);
$this->assertEquals($expectedIcon, $actual);
@@ -113,9 +111,7 @@ class PredefinedStatusServiceTest extends TestCase {
];
}
- /**
- * @dataProvider getTranslatedStatusForIdDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('getTranslatedStatusForIdDataProvider')]
public function testGetTranslatedStatusForId(string $id, ?string $expected): void {
$this->l10n->method('t')
->willReturnArgument(0);
@@ -136,9 +132,7 @@ class PredefinedStatusServiceTest extends TestCase {
];
}
- /**
- * @dataProvider isValidIdDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('isValidIdDataProvider')]
public function testIsValidId(string $id, bool $expected): void {
$actual = $this->service->isValidId($id);
$this->assertEquals($expected, $actual);
diff --git a/apps/user_status/tests/Unit/Service/StatusServiceTest.php b/apps/user_status/tests/Unit/Service/StatusServiceTest.php
index 7aeb1d48448..7dfa5b0d064 100644
--- a/apps/user_status/tests/Unit/Service/StatusServiceTest.php
+++ b/apps/user_status/tests/Unit/Service/StatusServiceTest.php
@@ -221,9 +221,7 @@ class StatusServiceTest extends TestCase {
$this->assertNull($status->getMessageId());
}
- /**
- * @dataProvider setStatusDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('setStatusDataProvider')]
public function testSetStatus(
string $userId,
string $status,
@@ -344,9 +342,7 @@ class StatusServiceTest extends TestCase {
];
}
- /**
- * @dataProvider setPredefinedMessageDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('setPredefinedMessageDataProvider')]
public function testSetPredefinedMessage(
string $userId,
string $messageId,
@@ -433,9 +429,7 @@ class StatusServiceTest extends TestCase {
];
}
- /**
- * @dataProvider setCustomMessageDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('setCustomMessageDataProvider')]
public function testSetCustomMessage(
string $userId,
?string $statusIcon,
@@ -799,9 +793,7 @@ class StatusServiceTest extends TestCase {
];
}
- /**
- * @dataProvider dataSetUserStatus
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataSetUserStatus')]
public function testSetUserStatus(string $messageId, string $oldMessageId, bool $expectedUpdateShortcut): void {
$previous = new UserStatus();
$previous->setId(1);