aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Core')
-rw-r--r--tests/Core/Command/Apps/AppsDisableTest.php2
-rw-r--r--tests/Core/Command/Apps/AppsEnableTest.php2
-rw-r--r--tests/Core/Command/Config/App/DeleteConfigTest.php4
-rw-r--r--tests/Core/Command/Config/App/GetConfigTest.php4
-rw-r--r--tests/Core/Command/Config/App/SetConfigTest.php4
-rw-r--r--tests/Core/Command/Config/ImportTest.php19
-rw-r--r--tests/Core/Command/Config/ListConfigsTest.php2
-rw-r--r--tests/Core/Command/Config/System/CastHelperTest.php8
-rw-r--r--tests/Core/Command/Config/System/DeleteConfigTest.php6
-rw-r--r--tests/Core/Command/Config/System/GetConfigTest.php4
-rw-r--r--tests/Core/Command/Config/System/SetConfigTest.php8
-rw-r--r--tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php18
-rw-r--r--tests/Core/Command/Encryption/DecryptAllTest.php8
-rw-r--r--tests/Core/Command/Encryption/DisableTest.php4
-rw-r--r--tests/Core/Command/Encryption/EnableTest.php4
-rw-r--r--tests/Core/Command/Encryption/EncryptAllTest.php10
-rw-r--r--tests/Core/Command/Encryption/SetDefaultModuleTest.php4
-rw-r--r--tests/Core/Command/Log/FileTest.php4
-rw-r--r--tests/Core/Command/Log/ManageTest.php8
-rw-r--r--tests/Core/Command/Maintenance/DataFingerprintTest.php2
-rw-r--r--tests/Core/Command/Maintenance/ModeTest.php2
-rw-r--r--tests/Core/Command/Preview/CleanupTest.php4
-rw-r--r--tests/Core/Command/Preview/RepairTest.php4
-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
-rw-r--r--tests/Core/Controller/AutoCompleteControllerTest.php4
-rw-r--r--tests/Core/Controller/ClientFlowLoginControllerTest.php2
-rw-r--r--tests/Core/Controller/GuestAvatarControllerTest.php3
-rw-r--r--tests/Core/Controller/LoginControllerTest.php4
-rw-r--r--tests/Core/Controller/LostControllerTest.php2
-rw-r--r--tests/Core/Controller/NavigationControllerTest.php4
-rw-r--r--tests/Core/Controller/WipeControllerTest.php6
-rw-r--r--tests/Core/Data/LoginFlowV2CredentialsTest.php2
-rw-r--r--tests/Core/Middleware/TwoFactorMiddlewareTest.php4
-rw-r--r--tests/Core/Service/LoginFlowV2ServiceUnitTest.php12
38 files changed, 79 insertions, 130 deletions
diff --git a/tests/Core/Command/Apps/AppsDisableTest.php b/tests/Core/Command/Apps/AppsDisableTest.php
index 283727c1a04..117af958054 100644
--- a/tests/Core/Command/Apps/AppsDisableTest.php
+++ b/tests/Core/Command/Apps/AppsDisableTest.php
@@ -37,12 +37,12 @@ class AppsDisableTest extends TestCase {
}
/**
- * @dataProvider dataCommandInput
* @param $appId
* @param $groups
* @param $statusCode
* @param $pattern
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataCommandInput')]
public function testCommandInput($appId, $statusCode, $pattern): void {
$input = ['app-id' => $appId];
diff --git a/tests/Core/Command/Apps/AppsEnableTest.php b/tests/Core/Command/Apps/AppsEnableTest.php
index efaa7da984b..604c670ae15 100644
--- a/tests/Core/Command/Apps/AppsEnableTest.php
+++ b/tests/Core/Command/Apps/AppsEnableTest.php
@@ -41,12 +41,12 @@ class AppsEnableTest extends TestCase {
}
/**
- * @dataProvider dataCommandInput
* @param $appId
* @param $groups
* @param $statusCode
* @param $pattern
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataCommandInput')]
public function testCommandInput($appId, $groups, $statusCode, $pattern): void {
$input = ['app-id' => $appId];
diff --git a/tests/Core/Command/Config/App/DeleteConfigTest.php b/tests/Core/Command/Config/App/DeleteConfigTest.php
index 6f7bfbf3a7c..9e43f389214 100644
--- a/tests/Core/Command/Config/App/DeleteConfigTest.php
+++ b/tests/Core/Command/Config/App/DeleteConfigTest.php
@@ -70,9 +70,7 @@ class DeleteConfigTest extends TestCase {
];
}
- /**
- * @dataProvider dataDelete
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataDelete')]
public function testDelete(string $configName, bool $configExists, bool $checkIfExists, int $expectedReturn, string $expectedMessage): void {
$this->appConfig->expects(($checkIfExists) ? $this->once() : $this->never())
->method('getKeys')
diff --git a/tests/Core/Command/Config/App/GetConfigTest.php b/tests/Core/Command/Config/App/GetConfigTest.php
index 63a02f263d0..13392cddf55 100644
--- a/tests/Core/Command/Config/App/GetConfigTest.php
+++ b/tests/Core/Command/Config/App/GetConfigTest.php
@@ -80,9 +80,7 @@ class GetConfigTest extends TestCase {
];
}
- /**
- * @dataProvider dataGet
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataGet')]
public function testGet(string $configName, mixed $value, bool $configExists, mixed $defaultValue, bool $hasDefault, string $outputFormat, int $expectedReturn, ?string $expectedMessage): void {
if (!$expectedReturn) {
if ($configExists) {
diff --git a/tests/Core/Command/Config/App/SetConfigTest.php b/tests/Core/Command/Config/App/SetConfigTest.php
index 596439d85a8..a5c62368163 100644
--- a/tests/Core/Command/Config/App/SetConfigTest.php
+++ b/tests/Core/Command/Config/App/SetConfigTest.php
@@ -60,9 +60,7 @@ class SetConfigTest extends TestCase {
];
}
- /**
- * @dataProvider dataSet
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataSet')]
public function testSet(string $configName, mixed $newValue, bool $configExists, bool $updateOnly, bool $updated, string $expectedMessage): void {
$this->appConfig->method('hasKey')
->with('app-name', $configName)
diff --git a/tests/Core/Command/Config/ImportTest.php b/tests/Core/Command/Config/ImportTest.php
index 4606b57f078..14cdd714d12 100644
--- a/tests/Core/Command/Config/ImportTest.php
+++ b/tests/Core/Command/Config/ImportTest.php
@@ -35,7 +35,7 @@ class ImportTest extends TestCase {
$this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock();
$this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
- /** @var \OCP\IConfig $config */
+ /** @var IConfig $config */
$this->command = new Import($config);
}
@@ -50,10 +50,9 @@ class ImportTest extends TestCase {
}
/**
- * @dataProvider validateAppsArrayData
- *
* @param mixed $configValue
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('validateAppsArrayData')]
public function testValidateAppsArray($configValue): void {
$this->invokePrivate($this->command, 'validateAppsArray', [['app' => ['name' => $configValue]]]);
$this->assertTrue(true, 'Asserting that no exception is thrown');
@@ -69,10 +68,9 @@ class ImportTest extends TestCase {
}
/**
- * @dataProvider validateAppsArrayThrowsData
- *
* @param mixed $configValue
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('validateAppsArrayThrowsData')]
public function testValidateAppsArrayThrows($configValue): void {
try {
$this->invokePrivate($this->command, 'validateAppsArray', [['app' => ['name' => $configValue]]]);
@@ -99,10 +97,9 @@ class ImportTest extends TestCase {
}
/**
- * @dataProvider checkTypeRecursivelyData
- *
* @param mixed $configValue
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('checkTypeRecursivelyData')]
public function testCheckTypeRecursively($configValue): void {
$this->invokePrivate($this->command, 'checkTypeRecursively', [$configValue, 'name']);
$this->assertTrue(true, 'Asserting that no exception is thrown');
@@ -118,10 +115,9 @@ class ImportTest extends TestCase {
}
/**
- * @dataProvider checkTypeRecursivelyThrowsData
- *
* @param mixed $configValue
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('checkTypeRecursivelyThrowsData')]
public function testCheckTypeRecursivelyThrows($configValue): void {
try {
$this->invokePrivate($this->command, 'checkTypeRecursively', [$configValue, 'name']);
@@ -140,10 +136,9 @@ class ImportTest extends TestCase {
}
/**
- * @dataProvider validateArrayData
- *
* @param array $configArray
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('validateArrayData')]
public function testValidateArray($configArray): void {
$this->invokePrivate($this->command, 'validateArray', [$configArray]);
$this->assertTrue(true, 'Asserting that no exception is thrown');
@@ -158,11 +153,11 @@ class ImportTest extends TestCase {
}
/**
- * @dataProvider validateArrayThrowsData
*
* @param mixed $configArray
* @param string $expectedException
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('validateArrayThrowsData')]
public function testValidateArrayThrows($configArray, $expectedException): void {
try {
$this->invokePrivate($this->command, 'validateArray', [$configArray]);
diff --git a/tests/Core/Command/Config/ListConfigsTest.php b/tests/Core/Command/Config/ListConfigsTest.php
index 4922fe2c185..2f2de288e9d 100644
--- a/tests/Core/Command/Config/ListConfigsTest.php
+++ b/tests/Core/Command/Config/ListConfigsTest.php
@@ -262,7 +262,6 @@ class ListConfigsTest extends TestCase {
}
/**
- * @dataProvider listData
*
* @param string $app
* @param array $systemConfigs
@@ -271,6 +270,7 @@ class ListConfigsTest extends TestCase {
* @param bool $private
* @param string $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('listData')]
public function testList($app, $systemConfigs, $systemConfigMap, $appConfig, $private, $expected): void {
$this->systemConfig->expects($this->any())
->method('getKeys')
diff --git a/tests/Core/Command/Config/System/CastHelperTest.php b/tests/Core/Command/Config/System/CastHelperTest.php
index e31f74b4a55..924887daaf7 100644
--- a/tests/Core/Command/Config/System/CastHelperTest.php
+++ b/tests/Core/Command/Config/System/CastHelperTest.php
@@ -37,9 +37,7 @@ class CastHelperTest extends TestCase {
];
}
- /**
- * @dataProvider castValueProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('castValueProvider')]
public function testCastValue($value, $type, $expectedValue): void {
$this->assertSame(
$expectedValue,
@@ -59,9 +57,7 @@ class CastHelperTest extends TestCase {
];
}
- /**
- * @dataProvider castValueInvalidProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('castValueInvalidProvider')]
public function testCastValueInvalid($value, $type): void {
$this->expectException(\InvalidArgumentException::class);
diff --git a/tests/Core/Command/Config/System/DeleteConfigTest.php b/tests/Core/Command/Config/System/DeleteConfigTest.php
index b40d2a9cdd1..b0a3580e1cd 100644
--- a/tests/Core/Command/Config/System/DeleteConfigTest.php
+++ b/tests/Core/Command/Config/System/DeleteConfigTest.php
@@ -35,7 +35,7 @@ class DeleteConfigTest extends TestCase {
$this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock();
$this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
- /** @var \OC\SystemConfig $systemConfig */
+ /** @var SystemConfig $systemConfig */
$this->command = new DeleteConfig($systemConfig);
}
@@ -73,7 +73,6 @@ class DeleteConfigTest extends TestCase {
}
/**
- * @dataProvider deleteData
*
* @param string $configName
* @param bool $configExists
@@ -81,6 +80,7 @@ class DeleteConfigTest extends TestCase {
* @param int $expectedReturn
* @param string $expectedMessage
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('deleteData')]
public function testDelete($configName, $configExists, $checkIfExists, $expectedReturn, $expectedMessage): void {
$this->systemConfig->expects(($checkIfExists) ? $this->once() : $this->never())
->method('getKeys')
@@ -166,7 +166,6 @@ class DeleteConfigTest extends TestCase {
}
/**
- * @dataProvider deleteArrayData
*
* @param string[] $configNames
* @param bool $configKeyExists
@@ -176,6 +175,7 @@ class DeleteConfigTest extends TestCase {
* @param int $expectedReturn
* @param string $expectedMessage
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('deleteArrayData')]
public function testArrayDelete(array $configNames, $configKeyExists, $checkIfKeyExists, $configValue, $updateValue, $expectedReturn, $expectedMessage): void {
$this->systemConfig->expects(($checkIfKeyExists) ? $this->once() : $this->never())
->method('getKeys')
diff --git a/tests/Core/Command/Config/System/GetConfigTest.php b/tests/Core/Command/Config/System/GetConfigTest.php
index bcab8afa3be..8b84fd14198 100644
--- a/tests/Core/Command/Config/System/GetConfigTest.php
+++ b/tests/Core/Command/Config/System/GetConfigTest.php
@@ -35,7 +35,7 @@ class GetConfigTest extends TestCase {
$this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock();
$this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
- /** @var \OC\SystemConfig $systemConfig */
+ /** @var SystemConfig $systemConfig */
$this->command = new GetConfig($systemConfig);
}
@@ -89,7 +89,6 @@ class GetConfigTest extends TestCase {
}
/**
- * @dataProvider getData
*
* @param string[] $configNames
* @param mixed $value
@@ -100,6 +99,7 @@ class GetConfigTest extends TestCase {
* @param int $expectedReturn
* @param string $expectedMessage
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('getData')]
public function testGet($configNames, $value, $configExists, $defaultValue, $hasDefault, $outputFormat, $expectedReturn, $expectedMessage): void {
if (is_array($configNames)) {
$configName = $configNames[0];
diff --git a/tests/Core/Command/Config/System/SetConfigTest.php b/tests/Core/Command/Config/System/SetConfigTest.php
index b0c7e1580c3..a99b832c160 100644
--- a/tests/Core/Command/Config/System/SetConfigTest.php
+++ b/tests/Core/Command/Config/System/SetConfigTest.php
@@ -36,7 +36,7 @@ class SetConfigTest extends TestCase {
$this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock();
$this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
- /** @var \OC\SystemConfig $systemConfig */
+ /** @var SystemConfig $systemConfig */
$this->command = new SetConfig($systemConfig, new CastHelper());
}
@@ -50,13 +50,13 @@ class SetConfigTest extends TestCase {
}
/**
- * @dataProvider dataTest
*
* @param array $configNames
* @param string $newValue
* @param mixed $existingData
* @param mixed $expectedValue
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTest')]
public function testSet($configNames, $newValue, $existingData, $expectedValue): void {
$this->systemConfig->expects($this->once())
->method('setValue')
@@ -87,9 +87,7 @@ class SetConfigTest extends TestCase {
];
}
- /**
- * @dataProvider setUpdateOnlyProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('setUpdateOnlyProvider')]
public function testSetUpdateOnly($configNames, $existingData): void {
$this->expectException(\UnexpectedValueException::class);
diff --git a/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php b/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php
index 789f6269e18..0bc6cbb64cf 100644
--- a/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php
+++ b/tests/Core/Command/Encryption/ChangeKeyStorageRootTest.php
@@ -46,7 +46,7 @@ class ChangeKeyStorageRootTest extends TestCase {
/** @var OutputInterface | \PHPUnit\Framework\MockObject\MockObject */
protected $outputInterface;
- /** @var \OCP\UserInterface | \PHPUnit\Framework\MockObject\MockObject */
+ /** @var UserInterface|\PHPUnit\Framework\MockObject\MockObject */
protected $userInterface;
protected function setUp(): void {
@@ -78,9 +78,7 @@ class ChangeKeyStorageRootTest extends TestCase {
);
}
- /**
- * @dataProvider dataTestExecute
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTestExecute')]
public function testExecute($newRoot, $answer, $successMoveKey): void {
$changeKeyStorageRoot = $this->getMockBuilder('OC\Core\Command\Encryption\ChangeKeyStorageRoot')
->setConstructorArgs(
@@ -135,7 +133,7 @@ class ChangeKeyStorageRootTest extends TestCase {
}
public function testMoveAllKeys(): void {
- /** @var \OC\Core\Command\Encryption\ChangeKeyStorageRoot $changeKeyStorageRoot */
+ /** @var ChangeKeyStorageRoot $changeKeyStorageRoot */
$changeKeyStorageRoot = $this->getMockBuilder('OC\Core\Command\Encryption\ChangeKeyStorageRoot')
->setConstructorArgs(
[
@@ -166,11 +164,11 @@ class ChangeKeyStorageRootTest extends TestCase {
}
/**
- * @dataProvider dataTestPrepareNewRootException
*
* @param bool $dirExists
* @param bool $couldCreateFile
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTestPrepareNewRootException')]
public function testPrepareNewRootException($dirExists, $couldCreateFile): void {
$this->expectException(\Exception::class);
@@ -190,12 +188,12 @@ class ChangeKeyStorageRootTest extends TestCase {
}
/**
- * @dataProvider dataTestMoveSystemKeys
*
* @param bool $dirExists
* @param bool $targetExists
* @param bool $executeRename
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTestMoveSystemKeys')]
public function testMoveSystemKeys($dirExists, $targetExists, $executeRename): void {
$changeKeyStorageRoot = $this->getMockBuilder('OC\Core\Command\Encryption\ChangeKeyStorageRoot')
->setConstructorArgs(
@@ -256,13 +254,13 @@ class ChangeKeyStorageRootTest extends TestCase {
}
/**
- * @dataProvider dataTestMoveUserEncryptionFolder
*
* @param bool $userExists
* @param bool $isDir
* @param bool $targetExists
* @param bool $shouldRename
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTestMoveUserEncryptionFolder')]
public function testMoveUserEncryptionFolder($userExists, $isDir, $targetExists, $shouldRename): void {
$changeKeyStorageRoot = $this->getMockBuilder('OC\Core\Command\Encryption\ChangeKeyStorageRoot')
->setConstructorArgs(
@@ -308,9 +306,7 @@ class ChangeKeyStorageRootTest extends TestCase {
}
- /**
- * @dataProvider dataTestPrepareParentFolder
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTestPrepareParentFolder')]
public function testPrepareParentFolder($path, $pathExists): void {
$this->view->expects($this->any())->method('file_exists')
->willReturnCallback(
diff --git a/tests/Core/Command/Encryption/DecryptAllTest.php b/tests/Core/Command/Encryption/DecryptAllTest.php
index ccf4e3209ce..41d9e4c713f 100644
--- a/tests/Core/Command/Encryption/DecryptAllTest.php
+++ b/tests/Core/Command/Encryption/DecryptAllTest.php
@@ -18,13 +18,13 @@ use Symfony\Component\Console\Output\OutputInterface;
use Test\TestCase;
class DecryptAllTest extends TestCase {
- /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\IConfig */
+ /** @var \PHPUnit\Framework\MockObject\MockObject|IConfig */
protected $config;
/** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\Encryption\IManager */
protected $encryptionManager;
- /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\App\IAppManager */
+ /** @var \PHPUnit\Framework\MockObject\MockObject|IAppManager */
protected $appManager;
/** @var \PHPUnit\Framework\MockObject\MockObject | \Symfony\Component\Console\Input\InputInterface */
@@ -110,9 +110,7 @@ class DecryptAllTest extends TestCase {
$this->invokePrivate($instance, 'resetMaintenanceAndTrashbin');
}
- /**
- * @dataProvider dataTestExecute
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTestExecute')]
public function testExecute($encryptionEnabled, $continue): void {
$instance = new DecryptAll(
$this->encryptionManager,
diff --git a/tests/Core/Command/Encryption/DisableTest.php b/tests/Core/Command/Encryption/DisableTest.php
index d4ea8e5c7dc..a89fd636e47 100644
--- a/tests/Core/Command/Encryption/DisableTest.php
+++ b/tests/Core/Command/Encryption/DisableTest.php
@@ -34,7 +34,7 @@ class DisableTest extends TestCase {
$this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock();
$this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
- /** @var \OCP\IConfig $config */
+ /** @var IConfig $config */
$this->command = new Disable($config);
}
@@ -47,12 +47,12 @@ class DisableTest extends TestCase {
}
/**
- * @dataProvider dataDisable
*
* @param string $oldStatus
* @param bool $isUpdating
* @param string $expectedString
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataDisable')]
public function testDisable($oldStatus, $isUpdating, $expectedString): void {
$this->config->expects($this->once())
->method('getAppValue')
diff --git a/tests/Core/Command/Encryption/EnableTest.php b/tests/Core/Command/Encryption/EnableTest.php
index b90ad14c893..32d1a7576f5 100644
--- a/tests/Core/Command/Encryption/EnableTest.php
+++ b/tests/Core/Command/Encryption/EnableTest.php
@@ -56,9 +56,7 @@ class EnableTest extends TestCase {
];
}
- /**
- * @dataProvider dataEnable
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataEnable')]
public function testEnable(string $oldStatus, ?string $defaultModule, array $availableModules, bool $isUpdating, string $expectedString, string $expectedDefaultModuleString): void {
if ($isUpdating) {
$this->config->expects($this->once())
diff --git a/tests/Core/Command/Encryption/EncryptAllTest.php b/tests/Core/Command/Encryption/EncryptAllTest.php
index e40b5d11c1b..6332c936a98 100644
--- a/tests/Core/Command/Encryption/EncryptAllTest.php
+++ b/tests/Core/Command/Encryption/EncryptAllTest.php
@@ -19,13 +19,13 @@ use Symfony\Component\Console\Output\OutputInterface;
use Test\TestCase;
class EncryptAllTest extends TestCase {
- /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\IConfig */
+ /** @var \PHPUnit\Framework\MockObject\MockObject|IConfig */
protected $config;
/** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\Encryption\IManager */
protected $encryptionManager;
- /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\App\IAppManager */
+ /** @var \PHPUnit\Framework\MockObject\MockObject|IAppManager */
protected $appManager;
/** @var \PHPUnit\Framework\MockObject\MockObject | \Symfony\Component\Console\Input\InputInterface */
@@ -37,7 +37,7 @@ class EncryptAllTest extends TestCase {
/** @var \PHPUnit\Framework\MockObject\MockObject | \Symfony\Component\Console\Helper\QuestionHelper */
protected $questionHelper;
- /** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\Encryption\IEncryptionModule */
+ /** @var \PHPUnit\Framework\MockObject\MockObject|IEncryptionModule */
protected $encryptionModule;
/** @var EncryptAll */
@@ -78,9 +78,7 @@ class EncryptAllTest extends TestCase {
$this->invokePrivate($instance, 'resetMaintenanceAndTrashbin');
}
- /**
- * @dataProvider dataTestExecute
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTestExecute')]
public function testExecute($answer, $askResult): void {
$command = new EncryptAll($this->encryptionManager, $this->appManager, $this->config, $this->questionHelper);
diff --git a/tests/Core/Command/Encryption/SetDefaultModuleTest.php b/tests/Core/Command/Encryption/SetDefaultModuleTest.php
index eb6baa0185f..df38d730db3 100644
--- a/tests/Core/Command/Encryption/SetDefaultModuleTest.php
+++ b/tests/Core/Command/Encryption/SetDefaultModuleTest.php
@@ -53,7 +53,6 @@ class SetDefaultModuleTest extends TestCase {
}
/**
- * @dataProvider dataSetDefaultModule
*
* @param string $oldModule
* @param string $newModule
@@ -61,6 +60,7 @@ class SetDefaultModuleTest extends TestCase {
* @param bool $updateSuccess
* @param string $expectedString
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataSetDefaultModule')]
public function testSetDefaultModule($oldModule, $newModule, $updateModule, $updateSuccess, $expectedString): void {
$this->consoleInput->expects($this->once())
->method('getArgument')
@@ -91,7 +91,6 @@ class SetDefaultModuleTest extends TestCase {
}
/**
- * @dataProvider dataSetDefaultModule
*
* @param string $oldModule
* @param string $newModule
@@ -99,6 +98,7 @@ class SetDefaultModuleTest extends TestCase {
* @param bool $updateSuccess
* @param string $expectedString
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataSetDefaultModule')]
public function testMaintenanceMode($oldModule, $newModule, $updateModule, $updateSuccess, $expectedString): void {
$this->consoleInput->expects($this->never())
->method('getArgument')
diff --git a/tests/Core/Command/Log/FileTest.php b/tests/Core/Command/Log/FileTest.php
index e75cf75b927..1aaf398b875 100644
--- a/tests/Core/Command/Log/FileTest.php
+++ b/tests/Core/Command/Log/FileTest.php
@@ -72,9 +72,7 @@ class FileTest extends TestCase {
];
}
- /**
- * @dataProvider changeRotateSizeProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('changeRotateSizeProvider')]
public function testChangeRotateSize($optionValue, $configValue): void {
$this->config->method('getSystemValue')->willReturnArgument(1);
$this->consoleInput->method('getOption')
diff --git a/tests/Core/Command/Log/ManageTest.php b/tests/Core/Command/Log/ManageTest.php
index d8714eb88d4..8b307048719 100644
--- a/tests/Core/Command/Log/ManageTest.php
+++ b/tests/Core/Command/Log/ManageTest.php
@@ -100,9 +100,7 @@ class ManageTest extends TestCase {
];
}
- /**
- * @dataProvider dataConvertLevelString
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataConvertLevelString')]
public function testConvertLevelString(string $levelString, int $expectedInt): void {
$this->assertEquals($expectedInt,
self::invokePrivate($this->command, 'convertLevelString', [$levelString])
@@ -126,9 +124,7 @@ class ManageTest extends TestCase {
];
}
- /**
- * @dataProvider dataConvertLevelNumber
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataConvertLevelNumber')]
public function testConvertLevelNumber(int $levelNum, string $expectedString): void {
$this->assertEquals($expectedString,
self::invokePrivate($this->command, 'convertLevelNumber', [$levelNum])
diff --git a/tests/Core/Command/Maintenance/DataFingerprintTest.php b/tests/Core/Command/Maintenance/DataFingerprintTest.php
index 31c90b7aea2..99004a7a5f5 100644
--- a/tests/Core/Command/Maintenance/DataFingerprintTest.php
+++ b/tests/Core/Command/Maintenance/DataFingerprintTest.php
@@ -36,7 +36,7 @@ class DataFingerprintTest extends TestCase {
$this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock();
$this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
- /** @var \OCP\IConfig $config */
+ /** @var IConfig $config */
$this->command = new DataFingerprint($this->config, $this->timeFactory);
}
diff --git a/tests/Core/Command/Maintenance/ModeTest.php b/tests/Core/Command/Maintenance/ModeTest.php
index 2aeca27f503..5a9a90b0197 100644
--- a/tests/Core/Command/Maintenance/ModeTest.php
+++ b/tests/Core/Command/Maintenance/ModeTest.php
@@ -112,7 +112,6 @@ class ModeTest extends TestCase {
/**
* Asserts that execute works as expected.
*
- * @dataProvider getExecuteTestData
* @param string $option The command option.
* @param bool $currentMaintenanceState The current maintenance state.
* @param null|bool $expectedMaintenanceState
@@ -120,6 +119,7 @@ class ModeTest extends TestCase {
* @param string $expectedOutput The expected command output.
* @throws \Exception
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('getExecuteTestData')]
public function testExecute(
string $option,
bool $currentMaintenanceState,
diff --git a/tests/Core/Command/Preview/CleanupTest.php b/tests/Core/Command/Preview/CleanupTest.php
index 5549fcf6d44..e4a83246e5b 100644
--- a/tests/Core/Command/Preview/CleanupTest.php
+++ b/tests/Core/Command/Preview/CleanupTest.php
@@ -100,9 +100,7 @@ class CleanupTest extends TestCase {
$this->assertEquals(1, $this->repair->run($this->input, $this->output));
}
- /**
- * @dataProvider dataForTestCleanupWithDeleteException
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataForTestCleanupWithDeleteException')]
public function testCleanupWithDeleteException(string $exceptionClass, string $errorMessage): void {
$previewFolder = $this->createMock(Folder::class);
$previewFolder->expects($this->once())
diff --git a/tests/Core/Command/Preview/RepairTest.php b/tests/Core/Command/Preview/RepairTest.php
index 167a29f44ae..9b9cde6dd95 100644
--- a/tests/Core/Command/Preview/RepairTest.php
+++ b/tests/Core/Command/Preview/RepairTest.php
@@ -111,9 +111,7 @@ class RepairTest extends TestCase {
];
}
- /**
- * @dataProvider dataEmptyTest
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataEmptyTest')]
public function testEmptyExecute($directoryNames, $expectedOutput): void {
$previewFolder = $this->getMockBuilder(Folder::class)
->getMock();
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',
diff --git a/tests/Core/Controller/AutoCompleteControllerTest.php b/tests/Core/Controller/AutoCompleteControllerTest.php
index 4af1feafad9..c5574f78fc1 100644
--- a/tests/Core/Controller/AutoCompleteControllerTest.php
+++ b/tests/Core/Controller/AutoCompleteControllerTest.php
@@ -154,9 +154,7 @@ class AutoCompleteControllerTest extends TestCase {
];
}
- /**
- * @dataProvider searchDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('searchDataProvider')]
public function testGet(array $searchResults, array $expected, string $searchTerm, ?string $itemType, ?string $itemId, ?string $sorter): void {
$this->collaboratorSearch->expects($this->once())
->method('search')
diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php
index 597c6641706..b182bb1bb39 100644
--- a/tests/Core/Controller/ClientFlowLoginControllerTest.php
+++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php
@@ -603,11 +603,11 @@ class ClientFlowLoginControllerTest extends TestCase {
}
/**
- * @dataProvider dataGeneratePasswordWithHttpsProxy
* @param array $headers
* @param string $protocol
* @param string $expected
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataGeneratePasswordWithHttpsProxy')]
public function testGeneratePasswordWithHttpsProxy(array $headers, $protocol, $expected): void {
$this->session
->expects($this->once())
diff --git a/tests/Core/Controller/GuestAvatarControllerTest.php b/tests/Core/Controller/GuestAvatarControllerTest.php
index 3e66cc8bad2..66a83098130 100644
--- a/tests/Core/Controller/GuestAvatarControllerTest.php
+++ b/tests/Core/Controller/GuestAvatarControllerTest.php
@@ -8,6 +8,7 @@ namespace Core\Controller;
use OC\Core\Controller\GuestAvatarController;
use OCP\AppFramework\Http\FileDisplayResponse;
+use OCP\Files\File;
use OCP\Files\SimpleFS\ISimpleFile;
use OCP\IAvatar;
use OCP\IAvatarManager;
@@ -39,7 +40,7 @@ class GuestAvatarControllerTest extends \Test\TestCase {
private $avatar;
/**
- * @var \OCP\Files\File|\PHPUnit\Framework\MockObject\MockObject
+ * @var File|\PHPUnit\Framework\MockObject\MockObject
*/
private $file;
diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php
index 6dcf4771f7e..18baaf5b08c 100644
--- a/tests/Core/Controller/LoginControllerTest.php
+++ b/tests/Core/Controller/LoginControllerTest.php
@@ -351,9 +351,7 @@ class LoginControllerTest extends TestCase {
];
}
- /**
- * @dataProvider passwordResetDataProvider
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('passwordResetDataProvider')]
public function testShowLoginFormWithPasswordResetOption($canChangePassword,
$expectedResult): void {
$this->userSession
diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php
index 84b6fb78a8f..bbb5f2c2e54 100644
--- a/tests/Core/Controller/LostControllerTest.php
+++ b/tests/Core/Controller/LostControllerTest.php
@@ -687,10 +687,10 @@ class LostControllerTest extends TestCase {
}
/**
- * @dataProvider dataTwoUsersWithSameEmailOneDisabled
* @param bool $userEnabled1
* @param bool $userEnabled2
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTwoUsersWithSameEmailOneDisabled')]
public function testTwoUsersWithSameEmailOneDisabled(bool $userEnabled1, bool $userEnabled2): void {
$user1 = $this->createMock(IUser::class);
$user1->method('getEMailAddress')
diff --git a/tests/Core/Controller/NavigationControllerTest.php b/tests/Core/Controller/NavigationControllerTest.php
index f7ce5bedef7..d00976f18ec 100644
--- a/tests/Core/Controller/NavigationControllerTest.php
+++ b/tests/Core/Controller/NavigationControllerTest.php
@@ -48,7 +48,7 @@ class NavigationControllerTest extends TestCase {
[true],
];
}
- /** @dataProvider dataGetNavigation */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataGetNavigation')]
public function testGetAppNavigation(bool $absolute): void {
$this->navigationManager->expects($this->once())
->method('getAll')
@@ -76,7 +76,7 @@ class NavigationControllerTest extends TestCase {
}
}
- /** @dataProvider dataGetNavigation */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataGetNavigation')]
public function testGetSettingsNavigation(bool $absolute): void {
$this->navigationManager->expects($this->once())
->method('getAll')
diff --git a/tests/Core/Controller/WipeControllerTest.php b/tests/Core/Controller/WipeControllerTest.php
index fa5f98988e7..5330eb599e6 100644
--- a/tests/Core/Controller/WipeControllerTest.php
+++ b/tests/Core/Controller/WipeControllerTest.php
@@ -47,9 +47,8 @@ class WipeControllerTest extends TestCase {
* @param bool $valid
* @param bool $couldPerform
* @param bool $result
- *
- * @dataProvider dataTest
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTest')]
public function testCheckWipe(bool $valid, bool $couldPerform, bool $result): void {
if (!$valid) {
$this->remoteWipe->method('start')
@@ -76,9 +75,8 @@ class WipeControllerTest extends TestCase {
* @param bool $valid
* @param bool $couldPerform
* @param bool $result
- *
- * @dataProvider dataTest
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataTest')]
public function testWipeDone(bool $valid, bool $couldPerform, bool $result): void {
if (!$valid) {
$this->remoteWipe->method('finish')
diff --git a/tests/Core/Data/LoginFlowV2CredentialsTest.php b/tests/Core/Data/LoginFlowV2CredentialsTest.php
index bad36610678..ffa06f1a451 100644
--- a/tests/Core/Data/LoginFlowV2CredentialsTest.php
+++ b/tests/Core/Data/LoginFlowV2CredentialsTest.php
@@ -12,7 +12,7 @@ use OC\Core\Data\LoginFlowV2Credentials;
use Test\TestCase;
class LoginFlowV2CredentialsTest extends TestCase {
- /** @var \OC\Core\Data\LoginFlowV2Credentials */
+ /** @var LoginFlowV2Credentials */
private $fixture;
public function setUp(): void {
diff --git a/tests/Core/Middleware/TwoFactorMiddlewareTest.php b/tests/Core/Middleware/TwoFactorMiddlewareTest.php
index 2d778a740dc..10afdd7c5e1 100644
--- a/tests/Core/Middleware/TwoFactorMiddlewareTest.php
+++ b/tests/Core/Middleware/TwoFactorMiddlewareTest.php
@@ -243,9 +243,7 @@ class TwoFactorMiddlewareTest extends TestCase {
];
}
- /**
- * @dataProvider dataRequires2FASetupDone
- */
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataRequires2FASetupDone')]
public function testRequires2FASetupDone(bool $hasProvider, bool $missingProviders, bool $expectEception): void {
if ($hasProvider) {
$provider = $this->createMock(IProvider::class);
diff --git a/tests/Core/Service/LoginFlowV2ServiceUnitTest.php b/tests/Core/Service/LoginFlowV2ServiceUnitTest.php
index b2c6f5c3027..5d05a1c6e0a 100644
--- a/tests/Core/Service/LoginFlowV2ServiceUnitTest.php
+++ b/tests/Core/Service/LoginFlowV2ServiceUnitTest.php
@@ -31,25 +31,25 @@ use Test\TestCase;
* Unit tests for \OC\Core\Service\LoginFlowV2Service
*/
class LoginFlowV2ServiceUnitTest extends TestCase {
- /** @var \OCP\IConfig */
+ /** @var IConfig */
private $config;
- /** @var \OCP\Security\ICrypto */
+ /** @var ICrypto */
private $crypto;
/** @var LoggerInterface|MockObject */
private $logger;
- /** @var \OC\Core\Db\LoginFlowV2Mapper */
+ /** @var LoginFlowV2Mapper */
private $mapper;
- /** @var \OCP\Security\ISecureRandom */
+ /** @var ISecureRandom */
private $secureRandom;
- /** @var \OC\Core\Service\LoginFlowV2Service */
+ /** @var LoginFlowV2Service */
private $subjectUnderTest;
- /** @var \OCP\AppFramework\Utility\ITimeFactory */
+ /** @var ITimeFactory */
private $timeFactory;
/** @var \OC\Authentication\Token\IProvider */