6 require_once 'application/HttpUtils.php';
9 * Unitary tests for client_ip_id()
11 class ClientIpIdTest
extends PHPUnit_Framework_TestCase
14 * Get a remote client ID based on its IP
16 public function testClientIpIdRemote()
20 client_ip_id(['REMOTE_ADDR' => '10.1.167.42'])
25 * Get a remote client ID based on its IP and proxy information (1)
27 public function testClientIpIdRemoteForwarded()
30 '10.1.167.42_127.0.1.47',
32 'REMOTE_ADDR' => '10.1.167.42',
33 'HTTP_X_FORWARDED_FOR' => '127.0.1.47'
39 * Get a remote client ID based on its IP and proxy information (2)
41 public function testClientIpIdRemoteForwardedClient()
44 '10.1.167.42_10.1.167.56_127.0.1.47',
46 'REMOTE_ADDR' => '10.1.167.42',
47 'HTTP_X_FORWARDED_FOR' => '10.1.167.56',
48 'HTTP_CLIENT_IP' => '127.0.1.47'