aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Accounts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Accounts')
-rw-r--r--tests/lib/Accounts/AccountManagerTest.php29
-rw-r--r--tests/lib/Accounts/AccountPropertyTest.php4
-rw-r--r--tests/lib/Accounts/HooksTest.php2
3 files changed, 9 insertions, 26 deletions
diff --git a/tests/lib/Accounts/AccountManagerTest.php b/tests/lib/Accounts/AccountManagerTest.php
index 6e2f30a2c26..2e1dc4ec70c 100644
--- a/tests/lib/Accounts/AccountManagerTest.php
+++ b/tests/lib/Accounts/AccountManagerTest.php
@@ -462,10 +462,7 @@ class AccountManagerTest extends TestCase {
->getMock();
}
- /**
- * @dataProvider dataTrueFalse
- *
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTrueFalse')]
public function testUpdateUser(array $newData, array $oldData, bool $insertNew, bool $updateExisting): void {
$accountManager = $this->getInstance(['getUser', 'insertNewUser', 'updateExistingUser']);
/** @var IUser $user */
@@ -684,9 +681,7 @@ class AccountManagerTest extends TestCase {
];
}
- /**
- * @dataProvider dataParsePhoneNumber
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataParsePhoneNumber')]
public function testSanitizePhoneNumberOnUpdateAccount(string $phoneInput, string $defaultRegion, ?string $phoneNumber): void {
$this->config->method('getSystemValueString')
->willReturn($defaultRegion);
@@ -738,9 +733,7 @@ class AccountManagerTest extends TestCase {
];
}
- /**
- * @dataProvider dataSanitizeOnUpdate
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataSanitizeOnUpdate')]
public function testSanitizingOnUpdateAccount(string $property, string $input, ?string $output): void {
if ($property === IAccountManager::PROPERTY_FEDIVERSE) {
@@ -823,9 +816,7 @@ class AccountManagerTest extends TestCase {
];
}
- /**
- * @dataProvider dataSanitizeFediverseServer
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataSanitizeFediverseServer')]
public function testSanitizingFediverseServer(string $input, ?string $output, bool $hasInternet, ?string $serverResponse): void {
$this->config->expects(self::once())
->method('getSystemValueBool')
@@ -882,9 +873,7 @@ class AccountManagerTest extends TestCase {
}
}
- /**
- * @dataProvider searchDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('searchDataProvider')]
public function testSearchUsers(string $property, array $values, array $expected): void {
$this->populateOrUpdate();
@@ -960,9 +949,7 @@ class AccountManagerTest extends TestCase {
];
}
- /**
- * @dataProvider dataCheckEmailVerification
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataCheckEmailVerification')]
public function testCheckEmailVerification(array $userData, ?string $newEmail): void {
$user = $this->makeUser(...$userData);
// Once because of getAccount, once because of getUser
@@ -1027,9 +1014,7 @@ class AccountManagerTest extends TestCase {
];
}
- /**
- * @dataProvider dataSetDefaultPropertyScopes
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataSetDefaultPropertyScopes')]
public function testSetDefaultPropertyScopes(array $propertyScopes, array $expectedResultScopes): void {
$user = $this->makeUser('steve', 'Steve Smith', 'steve@steve.steve');
$this->config->expects($this->once())->method('getSystemValue')->with('account_manager.default_property_scope', [])->willReturn($propertyScopes);
diff --git a/tests/lib/Accounts/AccountPropertyTest.php b/tests/lib/Accounts/AccountPropertyTest.php
index 940a71027fe..b92e45176a3 100644
--- a/tests/lib/Accounts/AccountPropertyTest.php
+++ b/tests/lib/Accounts/AccountPropertyTest.php
@@ -70,9 +70,7 @@ class AccountPropertyTest extends TestCase {
];
}
- /**
- * @dataProvider scopesProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('scopesProvider')]
public function testSetScopeMapping(string $storedScope, ?string $returnedScope): void {
if ($returnedScope === null) {
$this->expectException(\InvalidArgumentException::class);
diff --git a/tests/lib/Accounts/HooksTest.php b/tests/lib/Accounts/HooksTest.php
index 9fe7e7b4997..622fb3c7461 100644
--- a/tests/lib/Accounts/HooksTest.php
+++ b/tests/lib/Accounts/HooksTest.php
@@ -44,7 +44,6 @@ class HooksTest extends TestCase {
}
/**
- * @dataProvider dataTestChangeUserHook
*
* @param $params
* @param $data
@@ -52,6 +51,7 @@ class HooksTest extends TestCase {
* @param $setDisplayName
* @param $error
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTestChangeUserHook')]
public function testChangeUserHook($params, $data, $setEmail, $setDisplayName, $error): void {
if ($error) {
$this->accountManager->expects($this->never())->method('updateAccount');