diff options
Diffstat (limited to 'tests/lib/Security/RemoteHostValidatorIntegrationTest.php')
-rw-r--r-- | tests/lib/Security/RemoteHostValidatorIntegrationTest.php | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/tests/lib/Security/RemoteHostValidatorIntegrationTest.php b/tests/lib/Security/RemoteHostValidatorIntegrationTest.php index 3cf99161b77..913acfa054d 100644 --- a/tests/lib/Security/RemoteHostValidatorIntegrationTest.php +++ b/tests/lib/Security/RemoteHostValidatorIntegrationTest.php @@ -2,25 +2,9 @@ declare(strict_types=1); -/* - * @copyright 2022 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @author 2022 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. +/** + * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace lib\Security; @@ -53,7 +37,7 @@ class RemoteHostValidatorIntegrationTest extends TestCase { ); } - public function localHostsData(): array { + public static function localHostsData(): array { return [ ['[::1]'], ['[::]'], @@ -89,9 +73,7 @@ class RemoteHostValidatorIntegrationTest extends TestCase { ]; } - /** - * @dataProvider localHostsData - */ + #[\PHPUnit\Framework\Attributes\DataProvider('localHostsData')] public function testLocalHostsWhenNotAllowed(string $host): void { $this->config ->method('getSystemValueBool') @@ -103,9 +85,7 @@ class RemoteHostValidatorIntegrationTest extends TestCase { self::assertFalse($isValid); } - /** - * @dataProvider localHostsData - */ + #[\PHPUnit\Framework\Attributes\DataProvider('localHostsData')] public function testLocalHostsWhenAllowed(string $host): void { $this->config ->method('getSystemValueBool') @@ -117,7 +97,7 @@ class RemoteHostValidatorIntegrationTest extends TestCase { self::assertTrue($isValid); } - public function externalAddressesData():array { + public static function externalAddressesData():array { return [ ['8.8.8.8'], ['8.8.4.4'], @@ -127,9 +107,7 @@ class RemoteHostValidatorIntegrationTest extends TestCase { ]; } - /** - * @dataProvider externalAddressesData - */ + #[\PHPUnit\Framework\Attributes\DataProvider('externalAddressesData')] public function testExternalHost(string $host): void { $this->config ->method('getSystemValueBool') |