You are here

private function RequestTest::getRequestInstanceForClientIpsForwardedTests 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::getRequestInstanceForClientIpsForwardedTests()
1 call to RequestTest::getRequestInstanceForClientIpsForwardedTests()
RequestTest::testGetClientIpsForwarded in vendor/symfony/http-foundation/Tests/RequestTest.php
@dataProvider testGetClientIpsForwardedProvider

File

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

Class

RequestTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

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