$request =
$this->
getRequestInstanceForClientIpTests($remoteAddr,
$httpForwardedFor,
$trustedProxies);
$this->
assertEquals($expected,
$request->
getClientIps());
} /**
* @dataProvider getClientIpsForwardedProvider
*/
public function testGetClientIpsForwarded($expected,
$remoteAddr,
$httpForwarded,
$trustedProxies) { $request =
$this->
getRequestInstanceForClientIpsForwardedTests($remoteAddr,
$httpForwarded,
$trustedProxies);
$this->
assertEquals($expected,
$request->
getClientIps());
} public static function getClientIpsForwardedProvider() { // $expected $remoteAddr $httpForwarded $trustedProxies
return [ [['127.0.0.1'
], '127.0.0.1', 'for="_gazonk"', null
],
[['127.0.0.1'
], '127.0.0.1', 'for="_gazonk"',
['127.0.0.1'
]],
[['88.88.88.88'
], '127.0.0.1', 'for="88.88.88.88:80"',
['127.0.0.1'
]],
[[