diff options
Diffstat (limited to 'tests/lib/App/DependencyAnalyzerTest.php')
-rw-r--r-- | tests/lib/App/DependencyAnalyzerTest.php | 76 |
1 files changed, 24 insertions, 52 deletions
diff --git a/tests/lib/App/DependencyAnalyzerTest.php b/tests/lib/App/DependencyAnalyzerTest.php index 1e37948d783..88cb6009cc0 100644 --- a/tests/lib/App/DependencyAnalyzerTest.php +++ b/tests/lib/App/DependencyAnalyzerTest.php @@ -1,13 +1,10 @@ <?php + /** - * @author Thomas Müller - * @author Lukas Reschke - * @copyright 2014 Thomas Müller deepdiver@owncloud.com - * @copyright 2016 Lukas Reschke <lukas@statuscode.ch> - * - * See the COPYING-README file. + * SPDX-FileCopyrightText: 2016-2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2014-2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-only */ - namespace Test\App; use OC\App\DependencyAnalyzer; @@ -16,7 +13,6 @@ use OCP\IL10N; use Test\TestCase; class DependencyAnalyzerTest extends TestCase { - /** @var Platform|\PHPUnit\Framework\MockObject\MockObject */ private $platformMock; @@ -35,7 +31,7 @@ class DependencyAnalyzerTest extends TestCase { ->willReturn('5.4.3'); $this->platformMock->expects($this->any()) ->method('getIntSize') - ->willReturn('4'); + ->willReturn(4); $this->platformMock->expects($this->any()) ->method('getDatabase') ->willReturn('mysql'); @@ -51,7 +47,7 @@ class DependencyAnalyzerTest extends TestCase { ->method('getLibraryVersion') ->willReturnCallback(function ($lib) { if ($lib === 'curl') { - return "2.3.4"; + return '2.3.4'; } return null; }); @@ -72,14 +68,14 @@ class DependencyAnalyzerTest extends TestCase { } /** - * @dataProvider providesPhpVersion * * @param string $expectedMissing * @param string $minVersion * @param string $maxVersion * @param string $intSize */ - public function testPhpVersion($expectedMissing, $minVersion, $maxVersion, $intSize) { + #[\PHPUnit\Framework\Attributes\DataProvider('providesPhpVersion')] + public function testPhpVersion($expectedMissing, $minVersion, $maxVersion, $intSize): void { $app = [ 'dependencies' => [ 'php' => [] @@ -101,11 +97,11 @@ class DependencyAnalyzerTest extends TestCase { } /** - * @dataProvider providesDatabases * @param $expectedMissing * @param $databases */ - public function testDatabases($expectedMissing, $databases) { + #[\PHPUnit\Framework\Attributes\DataProvider('providesDatabases')] + public function testDatabases($expectedMissing, $databases): void { $app = [ 'dependencies' => [ ] @@ -120,12 +116,12 @@ class DependencyAnalyzerTest extends TestCase { } /** - * @dataProvider providesCommands * * @param string $expectedMissing * @param string|null $commands */ - public function testCommand($expectedMissing, $commands) { + #[\PHPUnit\Framework\Attributes\DataProvider('providesCommands')] + public function testCommand($expectedMissing, $commands): void { $app = [ 'dependencies' => [ ] @@ -140,11 +136,11 @@ class DependencyAnalyzerTest extends TestCase { } /** - * @dataProvider providesLibs * @param $expectedMissing * @param $libs */ - public function testLibs($expectedMissing, $libs) { + #[\PHPUnit\Framework\Attributes\DataProvider('providesLibs')] + public function testLibs($expectedMissing, $libs): void { $app = [ 'dependencies' => [ ] @@ -160,11 +156,11 @@ class DependencyAnalyzerTest extends TestCase { } /** - * @dataProvider providesOS * @param $expectedMissing * @param $oss */ - public function testOS($expectedMissing, $oss) { + #[\PHPUnit\Framework\Attributes\DataProvider('providesOS')] + public function testOS($expectedMissing, $oss): void { $app = [ 'dependencies' => [] ]; @@ -179,11 +175,11 @@ class DependencyAnalyzerTest extends TestCase { } /** - * @dataProvider providesOC * @param $expectedMissing * @param $oc */ - public function testOC($expectedMissing, $oc) { + #[\PHPUnit\Framework\Attributes\DataProvider('providesOC')] + public function testOC($expectedMissing, $oc): void { $app = [ 'dependencies' => [] ]; @@ -200,7 +196,7 @@ class DependencyAnalyzerTest extends TestCase { /** * @return array */ - public function providesOC() { + public static function providesOC(): array { return [ // no version -> no missing dependency [ @@ -283,18 +279,6 @@ class DependencyAnalyzerTest extends TestCase { ], [ [ - 'Server version 10 or higher is required.', - ], - [ - 'nextcloud' => [ - '@attributes' => [ - 'min-version' => '9.1', - ], - ], - ], - ], - [ - [ 'Server version 9.2 or higher is required.', ], [ @@ -388,18 +372,6 @@ class DependencyAnalyzerTest extends TestCase { ], [ [ - 'Server version 10 or higher is required.', - ], - [ - 'owncloud' => [ - '@attributes' => [ - 'min-version' => '9.1', - ], - ], - ], - ], - [ - [ 'Server version 9.2 or higher is required.', ], [ @@ -428,7 +400,7 @@ class DependencyAnalyzerTest extends TestCase { /** * @return array */ - public function providesOS() { + public static function providesOS(): array { return [ [[], null], [[], []], @@ -440,7 +412,7 @@ class DependencyAnalyzerTest extends TestCase { /** * @return array */ - public function providesLibs() { + public static function providesLibs(): array { return [ // we expect curl to exist [[], 'curl'], @@ -470,7 +442,7 @@ class DependencyAnalyzerTest extends TestCase { /** * @return array */ - public function providesCommands() { + public static function providesCommands(): array { return [ [[], null], // grep is known on linux @@ -488,7 +460,7 @@ class DependencyAnalyzerTest extends TestCase { /** * @return array */ - public function providesDatabases() { + public static function providesDatabases(): array { return [ // non BC - in case on databases are defined -> all are supported [[], null], @@ -501,7 +473,7 @@ class DependencyAnalyzerTest extends TestCase { /** * @return array */ - public function providesPhpVersion() { + public static function providesPhpVersion(): array { return [ [[], null, null, null], [[], '5.4', null, null], |