Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Add tests for changed ipv4 behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
ravage84 committed Aug 26, 2015
1 parent ae3d5a9 commit c2d1030
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/Faker/Provider/InternetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ public function testIpv4()
$this->assertNotFalse(filter_var($this->faker->ipv4(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4));
}

public function testIpv4NotLocalNetwork()
{
$this->assertNotEquals('1.0.0.0', long2ip(ip2long($this->faker->ipv4()) & (-1 << (32 - 8))));
}

public function testIpv4NotBroadcast()
{
$this->assertNotEquals('255.255.255.255', $this->faker->ipv4());
}

public function testIpv6()
{
$this->assertNotFalse(filter_var($this->faker->ipv6(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
Expand Down

0 comments on commit c2d1030

Please sign in to comment.