aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core/Command/User
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Core/Command/User')
-rw-r--r--tests/Core/Command/User/AddTest.php4
-rw-r--r--tests/Core/Command/User/DeleteTest.php4
-rw-r--r--tests/Core/Command/User/LastSeenTest.php4
-rw-r--r--tests/Core/Command/User/ProfileTest.php11
-rw-r--r--tests/Core/Command/User/SettingTest.php8
5 files changed, 12 insertions, 19 deletions
diff --git a/tests/Core/Command/User/AddTest.php b/tests/Core/Command/User/AddTest.php
index c9137bfc01c..5a8bc3abea1 100644
--- a/tests/Core/Command/User/AddTest.php
+++ b/tests/Core/Command/User/AddTest.php
@@ -84,9 +84,7 @@ class AddTest extends TestCase {
);
}
- /**
- * @dataProvider addEmailDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('addEmailDataProvider')]
public function testAddEmail(
?string $email,
bool $isEmailValid,
diff --git a/tests/Core/Command/User/DeleteTest.php b/tests/Core/Command/User/DeleteTest.php
index 424b1ebf3d3..4e06b0f91fc 100644
--- a/tests/Core/Command/User/DeleteTest.php
+++ b/tests/Core/Command/User/DeleteTest.php
@@ -35,7 +35,7 @@ class DeleteTest extends TestCase {
$this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock();
$this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
- /** @var \OCP\IUserManager $userManager */
+ /** @var IUserManager $userManager */
$this->command = new Delete($userManager);
}
@@ -48,11 +48,11 @@ class DeleteTest extends TestCase {
}
/**
- * @dataProvider validUserLastSeen
*
* @param bool $deleteSuccess
* @param string $expectedString
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('validUserLastSeen')]
public function testValidUser($deleteSuccess, $expectedString): void {
$user = $this->getMockBuilder(IUser::class)->getMock();
$user->expects($this->once())
diff --git a/tests/Core/Command/User/LastSeenTest.php b/tests/Core/Command/User/LastSeenTest.php
index 3b486f2f4c8..64c710eacc5 100644
--- a/tests/Core/Command/User/LastSeenTest.php
+++ b/tests/Core/Command/User/LastSeenTest.php
@@ -35,7 +35,7 @@ class LastSeenTest extends TestCase {
$this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock();
$this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
- /** @var \OCP\IUserManager $userManager */
+ /** @var IUserManager $userManager */
$this->command = new LastSeen($userManager);
}
@@ -47,11 +47,11 @@ class LastSeenTest extends TestCase {
}
/**
- * @dataProvider validUserLastSeen
*
* @param int $lastSeen
* @param string $expectedString
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('validUserLastSeen')]
public function testValidUser($lastSeen, $expectedString): void {
$user = $this->getMockBuilder(IUser::class)->getMock();
$user->expects($this->once())
diff --git a/tests/Core/Command/User/ProfileTest.php b/tests/Core/Command/User/ProfileTest.php
index 2e3227ab56b..ff5568bacfc 100644
--- a/tests/Core/Command/User/ProfileTest.php
+++ b/tests/Core/Command/User/ProfileTest.php
@@ -166,9 +166,7 @@ class ProfileTest extends TestCase {
];
}
- /**
- * @dataProvider dataCheckInput
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataCheckInput')]
public function testCheckInput(array $arguments, array $options, array $parameterOptions, bool $existingUser, ?string $expectedException): void {
$this->consoleInput->expects($this->any())
->method('getArgument')
@@ -233,9 +231,8 @@ class ProfileTest extends TestCase {
/**
* Tests the deletion mechanism on profile settings.
- *
- * @dataProvider dataExecuteDeleteProfileProperty
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataExecuteDeleteProfileProperty')]
public function testExecuteDeleteProfileProperty(string $configKey, string $value, bool $errorIfNotExists, ?string $expectedLine, int $expectedReturn): void {
$uid = 'username';
$appName = 'profile';
@@ -327,9 +324,7 @@ class ProfileTest extends TestCase {
];
}
- /**
- * @dataProvider dataExecuteGet
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataExecuteGet')]
public function testExecuteGet(string $key, string $value, ?string $defaultValue, string $expectedLine, int $expectedReturn): void {
$command = $this->getCommand([
'writeArrayInOutputFormat',
diff --git a/tests/Core/Command/User/SettingTest.php b/tests/Core/Command/User/SettingTest.php
index 80993a82bf1..706e5b24742 100644
--- a/tests/Core/Command/User/SettingTest.php
+++ b/tests/Core/Command/User/SettingTest.php
@@ -164,7 +164,6 @@ class SettingTest extends TestCase {
}
/**
- * @dataProvider dataCheckInput
*
* @param array $arguments
* @param array $options
@@ -172,6 +171,7 @@ class SettingTest extends TestCase {
* @param mixed $user
* @param string $expectedException
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataCheckInput')]
public function testCheckInput($arguments, $options, $parameterOptions, $user, $expectedException): void {
$this->consoleInput->expects($this->any())
->method('getArgument')
@@ -233,13 +233,13 @@ class SettingTest extends TestCase {
}
/**
- * @dataProvider dataExecuteDelete
*
* @param string|null $value
* @param bool $errorIfNotExists
* @param string $expectedLine
* @param int $expectedReturn
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataExecuteDelete')]
public function testExecuteDelete($value, $errorIfNotExists, $expectedLine, $expectedReturn): void {
$command = $this->getCommand([
'writeArrayInOutputFormat',
@@ -297,13 +297,13 @@ class SettingTest extends TestCase {
}
/**
- * @dataProvider dataExecuteSet
*
* @param string|null $value
* @param bool $updateOnly
* @param string $expectedLine
* @param int $expectedReturn
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataExecuteSet')]
public function testExecuteSet($value, $updateOnly, $expectedLine, $expectedReturn): void {
$command = $this->getCommand([
'writeArrayInOutputFormat',
@@ -364,13 +364,13 @@ class SettingTest extends TestCase {
}
/**
- * @dataProvider dataExecuteGet
*
* @param string|null $value
* @param string|null $defaultValue
* @param string $expectedLine
* @param int $expectedReturn
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataExecuteGet')]
public function testExecuteGet($value, $defaultValue, $expectedLine, $expectedReturn): void {
$command = $this->getCommand([
'writeArrayInOutputFormat',