You are here

private function RequestTest::getRequestInstanceForClientIpTests in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/RequestTest.php \Symfony\Component\HttpFoundation\Tests\RequestTest::getRequestInstanceForClientIpTests()
2 calls to RequestTest::getRequestInstanceForClientIpTests()
RequestTest::testGetClientIp in vendor/symfony/http-foundation/Tests/RequestTest.php
@dataProvider testGetClientIpsProvider
RequestTest::testGetClientIps in vendor/symfony/http-foundation/Tests/RequestTest.php
@dataProvider testGetClientIpsProvider

File

vendor/symfony/http-foundation/Tests/RequestTest.php, line 1548

Class

RequestTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

private function getRequestInstanceForClientIpTests($remoteAddr, $httpForwardedFor, $trustedProxies) {
  $request = new Request();
  $server = array(
    'REMOTE_ADDR' => $remoteAddr,
  );
  if (null !== $httpForwardedFor) {
    $server['HTTP_X_FORWARDED_FOR'] = $httpForwardedFor;
  }
  if ($trustedProxies) {
    Request::setTrustedProxies($trustedProxies);
  }
  $request
    ->initialize(array(), array(), array(), array(), array(), $server);
  return $request;
}