Ejemplo n.º 1
0
 /**
  * Test that getClientIp properly returns possible values for the user's IP address, obtained in different ways
  * due to proxy considerations.
  * 
  * @param string $ip
  * @param string $key
  * @dataProvider providerGetClientIp
  */
 public function testGetClientIp($ip, $key = 'REMOTE_ADDR')
 {
     $_SERVER[$key] = $ip;
     $ipArray = $this->request->getClientIp();
     $this->assertEquals($ip, $ipArray['ip']);
     unset($_SERVER[$key]);
 }