aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core/Command/Config
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Core/Command/Config')
-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
9 files changed, 21 insertions, 38 deletions
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);