aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Security/Ip
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Security/Ip')
-rw-r--r--tests/lib/Security/Ip/BruteforceAllowListTest.php5
-rw-r--r--tests/lib/Security/Ip/RemoteAddressTest.php4
2 files changed, 4 insertions, 5 deletions
diff --git a/tests/lib/Security/Ip/BruteforceAllowListTest.php b/tests/lib/Security/Ip/BruteforceAllowListTest.php
index f7ef9e3df72..0cffc128d64 100644
--- a/tests/lib/Security/Ip/BruteforceAllowListTest.php
+++ b/tests/lib/Security/Ip/BruteforceAllowListTest.php
@@ -42,7 +42,7 @@ class BruteforceAllowListTest extends TestCase {
);
}
- public function dataIsBypassListed(): array {
+ public static function dataIsBypassListed(): array {
return [
[
'10.10.10.10',
@@ -130,10 +130,9 @@ class BruteforceAllowListTest extends TestCase {
}
/**
- * @dataProvider dataIsBypassListed
- *
* @param string[] $allowList
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataIsBypassListed')]
public function testIsBypassListed(
string $ip,
array $allowList,
diff --git a/tests/lib/Security/Ip/RemoteAddressTest.php b/tests/lib/Security/Ip/RemoteAddressTest.php
index d1f621796fe..a6619cffe8e 100644
--- a/tests/lib/Security/Ip/RemoteAddressTest.php
+++ b/tests/lib/Security/Ip/RemoteAddressTest.php
@@ -25,8 +25,8 @@ class RemoteAddressTest extends \Test\TestCase {
/**
* @param mixed $allowedRanges
- * @dataProvider dataProvider
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('dataProvider')]
public function testAllowedIps(string $remoteIp, $allowedRanges, bool $expected): void {
$this->request
->method('getRemoteAddress')
@@ -44,7 +44,7 @@ class RemoteAddressTest extends \Test\TestCase {
/**
* @return array<string, mixed, bool>
*/
- public function dataProvider(): array {
+ public static function dataProvider(): array {
return [
// No IP (ie. CLI)
['', ['192.168.1.2/24'], true],