pickles/tests/BrowserTest.php
Josh Sherman 3b8eddc7b5 Dropped status code method
The function `http_response_code` was added in PHP 5.4 which deprecated the
code I had written. Dropped functionality and tests and updated code to use the
new function.
2014-09-28 08:36:14 -04:00

36 lines
774 B
PHP

<?php
class BrowserTest extends PHPUnit_Framework_TestCase
{
public function testRemoteIPNone()
{
$this->assertFalse(Pickles\Browser::remoteIP());
}
public function testRemoteIPRemoteAddress()
{
$_SERVER['REMOTE_ADDR'] = '1.2.3.4';
$this->assertEquals('1.2.3.4', Pickles\Browser::remoteIP());
}
public function testRemoteIPHTTPXForwardedFor()
{
$_SERVER['HTTP_X_FORWARDED_FOR'] = '2.3.4.5';
$this->assertEquals('2.3.4.5', Pickles\Browser::remoteIP());
}
public function testRemoteIPHTTPClientIP()
{
$_SERVER['HTTP_CLIENT_IP'] = '3.4.5.6';
$this->assertEquals('3.4.5.6', Pickles\Browser::remoteIP());
}
public function testRemoteIPWithComma()
{
}
}