You are here

public function IpUtilsTest::testIpv4Provider in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/IpUtilsTest.php \Symfony\Component\HttpFoundation\Tests\IpUtilsTest::testIpv4Provider()

File

vendor/symfony/http-foundation/Tests/IpUtilsTest.php, line 26

Class

IpUtilsTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testIpv4Provider() {
  return array(
    array(
      true,
      '192.168.1.1',
      '192.168.1.1',
    ),
    array(
      true,
      '192.168.1.1',
      '192.168.1.1/1',
    ),
    array(
      true,
      '192.168.1.1',
      '192.168.1.0/24',
    ),
    array(
      false,
      '192.168.1.1',
      '1.2.3.4/1',
    ),
    array(
      false,
      '192.168.1.1',
      '192.168.1/33',
    ),
    array(
      true,
      '192.168.1.1',
      array(
        '1.2.3.4/1',
        '192.168.1.0/24',
      ),
    ),
    array(
      true,
      '192.168.1.1',
      array(
        '192.168.1.0/24',
        '1.2.3.4/1',
      ),
    ),
    array(
      false,
      '192.168.1.1',
      array(
        '1.2.3.4/1',
        '4.3.2.1/1',
      ),
    ),
    array(
      true,
      '1.2.3.4',
      '0.0.0.0/0',
    ),
    array(
      false,
      '1.2.3.4',
      '256.256.256/0',
    ),
    array(
      false,
      '1.2.3.4',
      '192.168.1.0/0',
    ),
  );
}