public function testGetRemote() { $_SERVER['REMOTE_ADDR'] = '192.168.0.1'; $_SERVER['HTTP_CLIENT_IP'] = '192.168.0.2'; $_SERVER['HTTP_X_REAL_IP'] = '192.168.0.3'; $_SERVER['HTTP_X_FORWARDED_FOR'] = '192.168.0.4'; is('192.168.0.1', Sys::IP()); // Check deprecated method is('192.168.0.1', IP::getRemote()); is('192.168.0.2', IP::getRemote(true)); unset($_SERVER['HTTP_CLIENT_IP']); is('192.168.0.3', IP::getRemote(true)); unset($_SERVER['HTTP_X_REAL_IP']); is('192.168.0.4', IP::getRemote(true)); unset($_SERVER['HTTP_X_FORWARDED_FOR']); is('192.168.0.1', IP::getRemote(true)); }