aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/App/DependencyAnalyzerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/App/DependencyAnalyzerTest.php')
-rw-r--r--tests/lib/App/DependencyAnalyzerTest.php63
1 files changed, 20 insertions, 43 deletions
diff --git a/tests/lib/App/DependencyAnalyzerTest.php b/tests/lib/App/DependencyAnalyzerTest.php
index 1b9c977e737..88cb6009cc0 100644
--- a/tests/lib/App/DependencyAnalyzerTest.php
+++ b/tests/lib/App/DependencyAnalyzerTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016-2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2014-2016 ownCloud, Inc.
@@ -46,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;
});
@@ -67,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' => []
@@ -96,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' => [
]
@@ -115,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' => [
]
@@ -135,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' => [
]
@@ -155,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' => []
];
@@ -174,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' => []
];
@@ -195,7 +196,7 @@ class DependencyAnalyzerTest extends TestCase {
/**
* @return array
*/
- public function providesOC() {
+ public static function providesOC(): array {
return [
// no version -> no missing dependency
[
@@ -278,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.',
],
[
@@ -383,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.',
],
[
@@ -423,7 +400,7 @@ class DependencyAnalyzerTest extends TestCase {
/**
* @return array
*/
- public function providesOS() {
+ public static function providesOS(): array {
return [
[[], null],
[[], []],
@@ -435,7 +412,7 @@ class DependencyAnalyzerTest extends TestCase {
/**
* @return array
*/
- public function providesLibs() {
+ public static function providesLibs(): array {
return [
// we expect curl to exist
[[], 'curl'],
@@ -465,7 +442,7 @@ class DependencyAnalyzerTest extends TestCase {
/**
* @return array
*/
- public function providesCommands() {
+ public static function providesCommands(): array {
return [
[[], null],
// grep is known on linux
@@ -483,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],
@@ -496,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],