Added auth test, cleaned up directory
This commit is contained in:
parent
a866a1a61b
commit
e45e1251e1
25 changed files with 134 additions and 15 deletions
36
tests/Pickles/BrowserTest.php
Normal file
36
tests/Pickles/BrowserTest.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue