lithium\tests\cases\action\DispatcherTest::testRunWithPostRoot PHP Method

testRunWithPostRoot() public method

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.
public testRunWithPostRoot ( )
    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);
    }