diff options
Diffstat (limited to 'tests/lib/Net')
-rw-r--r-- | tests/lib/Net/HostnameClassifierTest.php | 12 | ||||
-rw-r--r-- | tests/lib/Net/IpAddressClassifierTest.php | 12 |
2 files changed, 8 insertions, 16 deletions
diff --git a/tests/lib/Net/HostnameClassifierTest.php b/tests/lib/Net/HostnameClassifierTest.php index 766246ed8ad..c03afdabe83 100644 --- a/tests/lib/Net/HostnameClassifierTest.php +++ b/tests/lib/Net/HostnameClassifierTest.php @@ -21,7 +21,7 @@ class HostnameClassifierTest extends TestCase { $this->classifier = new HostnameClassifier(); } - public function localHostnamesData():array { + public static function localHostnamesData(): array { return [ ['localhost'], ['localHost'], @@ -32,16 +32,14 @@ class HostnameClassifierTest extends TestCase { ]; } - /** - * @dataProvider localHostnamesData - */ + #[\PHPUnit\Framework\Attributes\DataProvider('localHostnamesData')] public function testLocalHostname(string $host): void { $isLocal = $this->classifier->isLocalHostname($host); self::assertTrue($isLocal); } - public function publicHostnamesData(): array { + public static function publicHostnamesData(): array { return [ ['example.com'], ['example.net'], @@ -51,9 +49,7 @@ class HostnameClassifierTest extends TestCase { ]; } - /** - * @dataProvider publicHostnamesData - */ + #[\PHPUnit\Framework\Attributes\DataProvider('publicHostnamesData')] public function testPublicHostname(string $host): void { $isLocal = $this->classifier->isLocalHostname($host); diff --git a/tests/lib/Net/IpAddressClassifierTest.php b/tests/lib/Net/IpAddressClassifierTest.php index 803be00f740..f20e1ec1785 100644 --- a/tests/lib/Net/IpAddressClassifierTest.php +++ b/tests/lib/Net/IpAddressClassifierTest.php @@ -21,7 +21,7 @@ class IpAddressClassifierTest extends TestCase { $this->classifier = new IpAddressClassifier(); } - public function publicIpAddressData(): array { + public static function publicIpAddressData(): array { return [ ['8.8.8.8'], ['8.8.4.4'], @@ -30,16 +30,14 @@ class IpAddressClassifierTest extends TestCase { ]; } - /** - * @dataProvider publicIpAddressData - */ + #[\PHPUnit\Framework\Attributes\DataProvider('publicIpAddressData')] public function testPublicAddress(string $ip): void { $isLocal = $this->classifier->isLocalAddress($ip); self::assertFalse($isLocal); } - public function localIpAddressData(): array { + public static function localIpAddressData(): array { return [ ['192.168.0.1'], ['fe80::200:5aee:feaa:20a2'], @@ -54,9 +52,7 @@ class IpAddressClassifierTest extends TestCase { ]; } - /** - * @dataProvider localIpAddressData - */ + #[\PHPUnit\Framework\Attributes\DataProvider('localIpAddressData')] public function testLocalAddress(string $ip): void { $isLocal = $this->classifier->isLocalAddress($ip); |