diff options
Diffstat (limited to 'tests/lib/App')
-rw-r--r-- | tests/lib/App/AppManagerTest.php | 13 | ||||
-rw-r--r-- | tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php | 4 | ||||
-rw-r--r-- | tests/lib/App/AppStore/Version/VersionParserTest.php | 2 | ||||
-rw-r--r-- | tests/lib/App/CompareVersionTest.php | 4 | ||||
-rw-r--r-- | tests/lib/App/DependencyAnalyzerTest.php | 12 | ||||
-rw-r--r-- | tests/lib/App/InfoParserTest.php | 10 | ||||
-rw-r--r-- | tests/lib/App/PlatformRepositoryTest.php | 2 |
7 files changed, 17 insertions, 30 deletions
diff --git a/tests/lib/App/AppManagerTest.php b/tests/lib/App/AppManagerTest.php index 5cd141c16a9..6637c529a1e 100644 --- a/tests/lib/App/AppManagerTest.php +++ b/tests/lib/App/AppManagerTest.php @@ -139,9 +139,7 @@ class AppManagerTest extends TestCase { ); } - /** - * @dataProvider dataGetAppIcon - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataGetAppIcon')] public function testGetAppIcon($callback, ?bool $dark, ?string $expected): void { $this->urlGenerator->expects($this->atLeastOnce()) ->method('imagePath') @@ -310,10 +308,9 @@ class AppManagerTest extends TestCase { } /** - * @dataProvider dataEnableAppForGroupsAllowedTypes - * * @param array $appInfo */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataEnableAppForGroupsAllowedTypes')] public function testEnableAppForGroupsAllowedTypes(array $appInfo): void { $group1 = $this->createMock(IGroup::class); $group1->method('getGID') @@ -369,11 +366,11 @@ class AppManagerTest extends TestCase { } /** - * @dataProvider dataEnableAppForGroupsForbiddenTypes * * @param string $type * */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataEnableAppForGroupsForbiddenTypes')] public function testEnableAppForGroupsForbiddenTypes($type): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('test can\'t be enabled for groups.'); @@ -776,9 +773,7 @@ class AppManagerTest extends TestCase { ]; } - /** - * @dataProvider isBackendRequiredDataProvider - */ + #[\PHPUnit\Framework\Attributes\DataProvider('isBackendRequiredDataProvider')] public function testIsBackendRequired( string $backend, array $appBackends, diff --git a/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php b/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php index 54de828c907..b9866396662 100644 --- a/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php +++ b/tests/lib/App/AppStore/Fetcher/AppDiscoverFetcherTest.php @@ -72,9 +72,7 @@ class AppDiscoverFetcherTest extends FetcherBase { $this->assertEquals([], $this->fetcher->get()); } - /** - * @dataProvider dataGetETag - */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataGetETag')] public function testGetEtag(?string $expected, bool $throws, string $content = ''): void { $folder = $this->createMock(ISimpleFolder::class); if (!$throws) { diff --git a/tests/lib/App/AppStore/Version/VersionParserTest.php b/tests/lib/App/AppStore/Version/VersionParserTest.php index d46b107748b..3ccc68bc076 100644 --- a/tests/lib/App/AppStore/Version/VersionParserTest.php +++ b/tests/lib/App/AppStore/Version/VersionParserTest.php @@ -57,11 +57,11 @@ class VersionParserTest extends TestCase { } /** - * @dataProvider versionProvider * * @param string $input * @param Version $expected */ + #[\PHPUnit\Framework\Attributes\DataProvider('versionProvider')] public function testGetVersion($input, Version $expected): void { $this->assertEquals($expected, $this->versionParser->getVersion($input)); diff --git a/tests/lib/App/CompareVersionTest.php b/tests/lib/App/CompareVersionTest.php index f357e47d670..3c8295f0ed7 100644 --- a/tests/lib/App/CompareVersionTest.php +++ b/tests/lib/App/CompareVersionTest.php @@ -54,9 +54,7 @@ class CompareVersionTest extends TestCase { ]; } - /** - * @dataProvider comparisonData - */ + #[\PHPUnit\Framework\Attributes\DataProvider('comparisonData')] public function testComparison(string $actualVersion, string $requiredVersion, string $comparator, bool $expected): void { $isCompatible = $this->compare->isCompatible($actualVersion, $requiredVersion, diff --git a/tests/lib/App/DependencyAnalyzerTest.php b/tests/lib/App/DependencyAnalyzerTest.php index a304b0935b7..db53d678881 100644 --- a/tests/lib/App/DependencyAnalyzerTest.php +++ b/tests/lib/App/DependencyAnalyzerTest.php @@ -68,13 +68,13 @@ class DependencyAnalyzerTest extends TestCase { } /** - * @dataProvider providesPhpVersion * * @param string $expectedMissing * @param string $minVersion * @param string $maxVersion * @param string $intSize */ + #[\PHPUnit\Framework\Attributes\DataProvider('providesPhpVersion')] public function testPhpVersion($expectedMissing, $minVersion, $maxVersion, $intSize): void { $app = [ 'dependencies' => [ @@ -97,10 +97,10 @@ class DependencyAnalyzerTest extends TestCase { } /** - * @dataProvider providesDatabases * @param $expectedMissing * @param $databases */ + #[\PHPUnit\Framework\Attributes\DataProvider('providesDatabases')] public function testDatabases($expectedMissing, $databases): void { $app = [ 'dependencies' => [ @@ -116,11 +116,11 @@ class DependencyAnalyzerTest extends TestCase { } /** - * @dataProvider providesCommands * * @param string $expectedMissing * @param string|null $commands */ + #[\PHPUnit\Framework\Attributes\DataProvider('providesCommands')] public function testCommand($expectedMissing, $commands): void { $app = [ 'dependencies' => [ @@ -136,10 +136,10 @@ class DependencyAnalyzerTest extends TestCase { } /** - * @dataProvider providesLibs * @param $expectedMissing * @param $libs */ + #[\PHPUnit\Framework\Attributes\DataProvider('providesLibs')] public function testLibs($expectedMissing, $libs): void { $app = [ 'dependencies' => [ @@ -156,10 +156,10 @@ class DependencyAnalyzerTest extends TestCase { } /** - * @dataProvider providesOS * @param $expectedMissing * @param $oss */ + #[\PHPUnit\Framework\Attributes\DataProvider('providesOS')] public function testOS($expectedMissing, $oss): void { $app = [ 'dependencies' => [] @@ -175,10 +175,10 @@ class DependencyAnalyzerTest extends TestCase { } /** - * @dataProvider providesOC * @param $expectedMissing * @param $oc */ + #[\PHPUnit\Framework\Attributes\DataProvider('providesOC')] public function testOC($expectedMissing, $oc): void { $app = [ 'dependencies' => [] diff --git a/tests/lib/App/InfoParserTest.php b/tests/lib/App/InfoParserTest.php index 028c98eca87..f7c6a2eb7bd 100644 --- a/tests/lib/App/InfoParserTest.php +++ b/tests/lib/App/InfoParserTest.php @@ -13,7 +13,7 @@ use OCP\Cache\CappedMemoryCache; use Test\TestCase; class InfoParserTest extends TestCase { - /** @var OCP\Cache\CappedMemoryCache */ + /** @var CappedMemoryCache */ private static $cache; public static function setUpBeforeClass(): void { @@ -32,16 +32,12 @@ class InfoParserTest extends TestCase { $this->assertEquals($expectedData, $data); } - /** - * @dataProvider providesInfoXml - */ + #[\PHPUnit\Framework\Attributes\DataProvider('providesInfoXml')] public function testParsingValidXmlWithoutCache($expectedJson, $xmlFile): void { $this->parserTest($expectedJson, $xmlFile); } - /** - * @dataProvider providesInfoXml - */ + #[\PHPUnit\Framework\Attributes\DataProvider('providesInfoXml')] public function testParsingValidXmlWithCache($expectedJson, $xmlFile): void { $this->parserTest($expectedJson, $xmlFile, self::$cache); } diff --git a/tests/lib/App/PlatformRepositoryTest.php b/tests/lib/App/PlatformRepositoryTest.php index 83947cf7197..bc0ecb97c5a 100644 --- a/tests/lib/App/PlatformRepositoryTest.php +++ b/tests/lib/App/PlatformRepositoryTest.php @@ -11,10 +11,10 @@ use OC\App\PlatformRepository; class PlatformRepositoryTest extends \Test\TestCase { /** - * @dataProvider providesVersions * @param $expected * @param $input */ + #[\PHPUnit\Framework\Attributes\DataProvider('providesVersions')] public function testVersion($input, $expected): void { $pr = new PlatformRepository(); $normalizedVersion = $pr->normalizeVersion($input); |