fix request tests.

This commit is contained in:
Taylor Otwell 2011-10-18 21:05:21 -05:00
parent d5d9776298
commit ba29a0bd38
1 changed files with 5 additions and 11 deletions

View File

@ -90,19 +90,13 @@ public function test_ip_method_returns_client_ip_address()
$this->assertEquals('0.0.0.0', Laravel\Request::ip());
}
public function test_protocol_returns_http_when_not_https()
public function test_protocol_returns_server_protocol()
{
$this->assertEquals('http', Laravel\Request::protocol());
$_SERVER['SERVER_PROTOCOL'] = 'taylor';
$this->assertEquals('taylor', Laravel\Request::protocol());
$_SERVER['HTTPS'] = 'off';
$this->assertEquals('http', Laravel\Request::protocol());
}
public function test_protocol_returns_https_when_https()
{
$_SERVER['HTTPS'] = 'on';
$this->assertEquals('https', Laravel\Request::protocol());
unset($_SERVER['SERVER_PROTOCOL']);
$this->assertEquals('HTTP/1.1', Laravel\Request::protocol());
}
public function test_ajax_method_returns_false_when_not_ajax()