public function RequestMatcherTest::testIpv6

@dataProvider testIpv6Provider

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php, line 46

Class

RequestMatcherTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testIpv6($matches, $remoteAddr, $cidr) {
  if (!defined('AF_INET6')) {
    $this
      ->markTestSkipped('Only works when PHP is compiled without the option "disable-ipv6".');
  }
  $request = Request::create('', 'get', array(), array(), array(), array(
    'REMOTE_ADDR' => $remoteAddr,
  ));
  $matcher = new RequestMatcher();
  $matcher
    ->matchIp($cidr);
  $this
    ->assertEquals($matches, $matcher
    ->matches($request));
}