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.php73
1 files changed, 23 insertions, 50 deletions
diff --git a/tests/lib/App/DependencyAnalyzerTest.php b/tests/lib/App/DependencyAnalyzerTest.php
index f2ae412c2f6..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;
@@ -50,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;
});
@@ -71,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' => []
@@ -100,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' => [
]
@@ -119,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' => [
]
@@ -139,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' => [
]
@@ -159,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' => []
];
@@ -178,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' => []
];
@@ -199,7 +196,7 @@ class DependencyAnalyzerTest extends TestCase {
/**
* @return array
*/
- public function providesOC() {
+ public static function providesOC(): array {
return [
// no version -> no missing dependency
[
@@ -282,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.',
],
[
@@ -387,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.',
],
[
@@ -427,7 +400,7 @@ class DependencyAnalyzerTest extends TestCase {
/**
* @return array
*/
- public function providesOS() {
+ public static function providesOS(): array {
return [
[[], null],
[[], []],
@@ -439,7 +412,7 @@ class DependencyAnalyzerTest extends TestCase {
/**
* @return array
*/
- public function providesLibs() {
+ public static function providesLibs(): array {
return [
// we expect curl to exist
[[], 'curl'],
@@ -469,7 +442,7 @@ class DependencyAnalyzerTest extends TestCase {
/**
* @return array
*/
- public function providesCommands() {
+ public static function providesCommands(): array {
return [
[[], null],
// grep is known on linux
@@ -487,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],
@@ -500,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],