diff options
author | Robin Appelman <robin@icewind.nl> | 2025-06-30 16:56:59 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2025-07-01 22:45:52 +0200 |
commit | aa15f9d16d5b46d04763c7deedb129990e819364 (patch) | |
tree | 758e0aebcac34a545f9a21806120a9fcb96f4cb6 /tests/Core/Command/Config/System | |
parent | 1620a0c0510a42b1da0a66488838f1ce3ba1210d (diff) | |
download | nextcloud-server-rector-phpunit10.tar.gz nextcloud-server-rector-phpunit10.zip |
chore: run rectorrector-phpunit10
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests/Core/Command/Config/System')
4 files changed, 10 insertions, 16 deletions
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); |