Skip to content

Commit c2d1030

Browse files
committed
Add tests for changed ipv4 behavior
1 parent ae3d5a9 commit c2d1030

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/Faker/Provider/InternetTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ public function testIpv4()
108108
$this->assertNotFalse(filter_var($this->faker->ipv4(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4));
109109
}
110110

111+
public function testIpv4NotLocalNetwork()
112+
{
113+
$this->assertNotEquals('1.0.0.0', long2ip(ip2long($this->faker->ipv4()) & (-1 << (32 - 8))));
114+
}
115+
116+
public function testIpv4NotBroadcast()
117+
{
118+
$this->assertNotEquals('255.255.255.255', $this->faker->ipv4());
119+
}
120+
111121
public function testIpv6()
112122
{
113123
$this->assertNotFalse(filter_var($this->faker->ipv6(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));

0 commit comments

Comments
 (0)