diff options
Diffstat (limited to 'tests/lib/Updater/ChangesCheckTest.php')
-rw-r--r-- | tests/lib/Updater/ChangesCheckTest.php | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/tests/lib/Updater/ChangesCheckTest.php b/tests/lib/Updater/ChangesCheckTest.php index 4b0c54b0881..dd0d97a9e80 100644 --- a/tests/lib/Updater/ChangesCheckTest.php +++ b/tests/lib/Updater/ChangesCheckTest.php @@ -51,9 +51,7 @@ class ChangesCheckTest extends TestCase { ]; } - /** - * @dataProvider statusCodeProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('statusCodeProvider')] public function testEvaluateResponse(int $statusCode, int $expected): void { $response = $this->createMock(IResponse::class); $response->expects($this->atLeastOnce()) @@ -271,9 +269,7 @@ class ChangesCheckTest extends TestCase { ]; } - /** - * @dataProvider changesXMLProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('changesXMLProvider')] public function testExtractData(string $body, array $expected): void { $actual = $this->invokePrivate($this->checker, 'extractData', [$body]); $this->assertSame($expected, $actual); @@ -286,9 +282,7 @@ class ChangesCheckTest extends TestCase { ]; } - /** - * @dataProvider etagProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('etagProvider')] public function testQueryChangesServer(string $etag): void { $uri = 'https://changes.nextcloud.server/?13.0.5'; $entry = $this->createMock(Changes::class); @@ -323,9 +317,7 @@ class ChangesCheckTest extends TestCase { ]; } - /** - * @dataProvider versionProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('versionProvider')] public function testNormalizeVersion(string $input, string $expected): void { $normalized = $this->checker->normalizeVersion($input); $this->assertSame($expected, $normalized); @@ -333,19 +325,16 @@ class ChangesCheckTest extends TestCase { public static function changeDataProvider():array { $testDataFound = $testDataNotFound = self::versionProvider(); - array_walk($testDataFound, static function (&$params) { + array_walk($testDataFound, static function (&$params): void { $params[] = true; }); - array_walk($testDataNotFound, static function (&$params) { + array_walk($testDataNotFound, static function (&$params): void { $params[] = false; }); return array_merge($testDataFound, $testDataNotFound); } - /** - * @dataProvider changeDataProvider - * - */ + #[\PHPUnit\Framework\Attributes\DataProvider('changeDataProvider')] public function testGetChangesForVersion(string $inputVersion, string $normalizedVersion, bool $isFound): void { $mocker = $this->mapper->expects($this->once()) ->method('getChanges') |