refactoring. added default controller. added uri class.
This commit is contained in:
@@ -10,39 +10,13 @@ class RequestTest extends PHPUnit_Framework_TestCase {
|
||||
Laravel\Request::$uri = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
*/
|
||||
public function test_exception_thrown_if_uri_cant_be_determined()
|
||||
{
|
||||
Laravel\Request::uri();
|
||||
}
|
||||
|
||||
public function test_uri_method_returns_path_info_if_set()
|
||||
{
|
||||
$_SERVER['PATH_INFO'] = 'something';
|
||||
$this->assertEquals('something', Laravel\Request::uri());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider requestUriProvider
|
||||
*/
|
||||
public function test_correct_uri_is_returned_when_request_uri_is_used($uri, $expectation)
|
||||
{
|
||||
$_SERVER['REQUEST_URI'] = $uri;
|
||||
$this->assertEquals($expectation, Laravel\Request::uri());
|
||||
}
|
||||
|
||||
public function test_format_returns_the_extension_of_the_request_uri()
|
||||
{
|
||||
$_SERVER['PATH_INFO'] = 'profile.json';
|
||||
$this->assertEquals('json', Laravel\Request::format());
|
||||
}
|
||||
|
||||
public function test_format_returns_html_if_no_format_is_available()
|
||||
{
|
||||
$_SERVER['PATH_INFO'] = 'profile';
|
||||
$this->assertEquals('html', Laravel\Request::format());
|
||||
$this->assertEquals($expectation, Laravel\Request::uri()->get());
|
||||
}
|
||||
|
||||
public function test_request_method_returns_spoofed_method_if_uri_is_spoofed()
|
||||
|
||||
Reference in New Issue
Block a user