diff options
Diffstat (limited to 'tests/lib/App/CompareVersionTest.php')
-rw-r--r-- | tests/lib/App/CompareVersionTest.php | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/tests/lib/App/CompareVersionTest.php b/tests/lib/App/CompareVersionTest.php index 0988304f8fc..3c8295f0ed7 100644 --- a/tests/lib/App/CompareVersionTest.php +++ b/tests/lib/App/CompareVersionTest.php @@ -3,25 +3,8 @@ declare(strict_types=1); /** - * @copyright 2018 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @author 2018 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * + * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace Test\App; @@ -40,7 +23,7 @@ class CompareVersionTest extends TestCase { $this->compare = new CompareVersion(); } - public function comparisonData() { + public static function comparisonData(): array { return [ // Compatible versions ['13.0.0.3', '13.0.0', '>=', true], @@ -71,25 +54,23 @@ class CompareVersionTest extends TestCase { ]; } - /** - * @dataProvider comparisonData - */ + #[\PHPUnit\Framework\Attributes\DataProvider('comparisonData')] public function testComparison(string $actualVersion, string $requiredVersion, - string $comparator, bool $expected) { + string $comparator, bool $expected): void { $isCompatible = $this->compare->isCompatible($actualVersion, $requiredVersion, $comparator); $this->assertEquals($expected, $isCompatible); } - public function testInvalidServerVersion() { + public function testInvalidServerVersion(): void { $actualVersion = '13'; $this->expectException(InvalidArgumentException::class); $this->compare->isCompatible($actualVersion, '13.0.0'); } - public function testInvalidRequiredVersion() { + public function testInvalidRequiredVersion(): void { $actualVersion = '13.0.0'; $this->expectException(InvalidArgumentException::class); |