Neos\Flow\Tests\Unit\Http\Component\TrustedProxiesComponentTest::getClientIpAddressReturnsTheIpAddressDerivedFromSeveralServerEnvironmentVariables PHP Method

getClientIpAddressReturnsTheIpAddressDerivedFromSeveralServerEnvironmentVariables() public method

public getClientIpAddressReturnsTheIpAddressDerivedFromSeveralServerEnvironmentVariables ( array $serverEnvironment, $expectedIpAddress )
$serverEnvironment array
    public function getClientIpAddressReturnsTheIpAddressDerivedFromSeveralServerEnvironmentVariables(array $serverEnvironment, $expectedIpAddress)
    {
        $defaultServerEnvironment = array('HTTP_USER_AGENT' => 'Flow/' . FLOW_VERSION_BRANCH . '.x', 'HTTP_HOST' => 'flow.typo3.org', 'SERVER_NAME' => 'typo3.org', 'SERVER_ADDR' => '217.29.36.55', 'SERVER_PORT' => 80, 'REMOTE_ADDR' => '17.172.224.47', 'SCRIPT_FILENAME' => FLOW_PATH_WEB . 'index.php', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'SCRIPT_NAME' => '/index.php', 'PHP_SELF' => '/index.php');
        $request = Request::create(new Uri('http://flow.typo3.org'), 'GET', array(), array(), array_replace($defaultServerEnvironment, $serverEnvironment));
        $trustedRequest = $this->callWithRequest($request);
        $this->assertSame($expectedIpAddress, $trustedRequest->getClientIpAddress());
    }