コード例 #1
0
ファイル: modRequestTest.php プロジェクト: rossng/revolution
 /**
  * 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]);
 }