diff options
Diffstat (limited to 'tests/lib/SetupTest.php')
-rw-r--r-- | tests/lib/SetupTest.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/lib/SetupTest.php b/tests/lib/SetupTest.php index 542e8a08feb..0be7eab36f6 100644 --- a/tests/lib/SetupTest.php +++ b/tests/lib/SetupTest.php @@ -1,9 +1,9 @@ <?php + /** - * Copyright (c) 2014 Lukas Reschke <lukas@owncloud.com> - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. + * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace Test; @@ -43,12 +43,12 @@ class SetupTest extends \Test\TestCase { $this->random = $this->createMock(ISecureRandom::class); $this->installer = $this->createMock(Installer::class); $this->setupClass = $this->getMockBuilder(Setup::class) - ->setMethods(['class_exists', 'is_callable', 'getAvailableDbDriversForPdo']) + ->onlyMethods(['class_exists', 'is_callable', 'getAvailableDbDriversForPdo']) ->setConstructorArgs([$this->config, $this->iniWrapper, $this->l10nFactory, $this->defaults, $this->logger, $this->random, $this->installer]) ->getMock(); } - public function testGetSupportedDatabasesWithOneWorking() { + public function testGetSupportedDatabasesWithOneWorking(): void { $this->config ->expects($this->once()) ->method('getValue') @@ -71,7 +71,7 @@ class SetupTest extends \Test\TestCase { $this->assertSame($expectedResult, $result); } - public function testGetSupportedDatabasesWithNoWorking() { + public function testGetSupportedDatabasesWithNoWorking(): void { $this->config ->expects($this->once()) ->method('getValue') @@ -91,7 +91,7 @@ class SetupTest extends \Test\TestCase { $this->assertSame([], $result); } - public function testGetSupportedDatabasesWithAllWorking() { + public function testGetSupportedDatabasesWithAllWorking(): void { $this->config ->expects($this->once()) ->method('getValue') @@ -117,7 +117,7 @@ class SetupTest extends \Test\TestCase { } - public function testGetSupportedDatabaseException() { + public function testGetSupportedDatabaseException(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('Supported databases are not properly configured.'); @@ -129,11 +129,11 @@ class SetupTest extends \Test\TestCase { } /** - * @dataProvider findWebRootProvider * @param $url * @param $expected */ - public function testFindWebRootCli($url, $expected) { + #[\PHPUnit\Framework\Attributes\DataProvider('findWebRootProvider')] + public function testFindWebRootCli($url, $expected): void { $cliState = \OC::$CLI; $this->config @@ -152,7 +152,7 @@ class SetupTest extends \Test\TestCase { $this->assertSame($webRoot, $expected); } - public function findWebRootProvider(): array { + public static function findWebRootProvider(): array { return [ 'https://www.example.com/nextcloud/' => ['https://www.example.com/nextcloud/', '/nextcloud'], 'https://www.example.com/nextcloud' => ['https://www.example.com/nextcloud', '/nextcloud'], |