diff options
Diffstat (limited to 'tests/lib/OCS/DiscoveryServiceTest.php')
-rw-r--r-- | tests/lib/OCS/DiscoveryServiceTest.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/lib/OCS/DiscoveryServiceTest.php b/tests/lib/OCS/DiscoveryServiceTest.php index 3db3163e11d..422c97f4221 100644 --- a/tests/lib/OCS/DiscoveryServiceTest.php +++ b/tests/lib/OCS/DiscoveryServiceTest.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -35,17 +36,17 @@ class DiscoveryServiceTest extends TestCase { } /** - * @dataProvider dataTestIsSafeUrl * * @param string $url * @param bool $expected */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataTestIsSafeUrl')] public function testIsSafeUrl($url, $expected): void { $result = $this->invokePrivate($this->discoveryService, 'isSafeUrl', [$url]); $this->assertSame($expected, $result); } - public function dataTestIsSafeUrl() { + public static function dataTestIsSafeUrl(): array { return [ ['api/ocs/v1.php/foo', true], ['/api/ocs/v1.php/foo', true], @@ -58,18 +59,18 @@ class DiscoveryServiceTest extends TestCase { } /** - * @dataProvider dataTestGetEndpoints * * @param array $decodedServices * @param string $service * @param array $expected */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataTestGetEndpoints')] public function testGetEndpoints($decodedServices, $service, $expected): void { $result = $this->invokePrivate($this->discoveryService, 'getEndpoints', [$decodedServices, $service]); $this->assertSame($expected, $result); } - public function dataTestGetEndpoints() { + public static function dataTestGetEndpoints(): array { return [ [['services' => ['myService' => ['endpoints' => []]]], 'myService', []], [['services' => ['myService' => ['endpoints' => ['foo' => '/bar']]]], 'myService', ['foo' => '/bar']], |