public function RequestMatcherTest::testAnIpv6WithOptionDisabledIpv6

File

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

Class

RequestMatcherTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testAnIpv6WithOptionDisabledIpv6() {
  if (defined('AF_INET6')) {
    $this
      ->markTestSkipped('Only works when PHP is compiled with the option "disable-ipv6".');
  }
  $request = Request::create('', 'get', array(), array(), array(), array(
    'REMOTE_ADDR' => '2a01:198:603:0:396e:4789:8e99:890f',
  ));
  $matcher = new RequestMatcher();
  $matcher
    ->matchIp('2a01:198:603:0::/65');
  try {
    $matcher
      ->matches($request);
    $this
      ->fail('An expected RuntimeException has not been raised.');
  } catch (\Exception $e) {
    $this
      ->assertInstanceOf('\\RuntimeException', $e);
  }
}