Extends
lithium\test\Unit
Tests that POST requests to the / URL work as expected.
This test belongs to the issue that POST requests (like submitting forms) to the /
URL don't work as expected, because they immediately get redirected to the same URL but
as GET requests (with no data attached to it). It veryfies that the Lithium dispatcher
works as expected and returns the correct controller/action combination.
Returns
voidSource
public function testRunWithPostRoot() {
Router::connect('/', array('controller' => 'test', 'action' => 'test'));
$request = new Request(array('url' => '/', 'env' => array(
'REQUEST_METHOD' => 'POST'
)));
MockDispatcher::run($request);
$expected = array('controller' => 'Test', 'action' => 'test');
$result = end(MockDispatcher::$dispatched);
$this->assertEqual($expected, $result->params);
}