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

Erratic result with testIpv4NotLocalNetwork #1146

Closed
remicollet opened this issue Feb 16, 2017 · 2 comments
Closed

Erratic result with testIpv4NotLocalNetwork #1146

remicollet opened this issue Feb 16, 2017 · 2 comments

Comments

@remicollet
Copy link
Contributor

This test sometime fails.

     public function ipv4()
    {
        return long2ip(mt_rand(0, 1) == 0 ? mt_rand(-2147483648, -2) : mt_rand(16777216, 2147483647));
    }

Which means value from 128.0.0.0 to 255.255.255.254 or from 1.0.0.0 to 127.255.255.255

    public function testIpv4NotLocalNetwork()
    {
        $this->assertNotRegExp('/\A1\./', $this->faker->ipv4());
    }

So, when ipv4 start with 1., test fails.

Looks like there is a bad logic there.

@remicollet
Copy link
Contributor Author

If ipv4 should not return "local" adresses (like the one generated by localIpv4), the ipv4 code should be fixed, else the test is not revelant.

@fzaninotto
Copy link
Owner

Fixed by #1269

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants