lithium\tests\cases\net\http\RouterTest::testConnectingWithRequiredParams PHP Метод

testConnectingWithRequiredParams() публичный Метод

Tests generating routes with required parameters which are not present in the URL.
    public function testConnectingWithRequiredParams()
    {
        $result = Router::connect('/{:controller}/{:action}', array('action' => 'view', 'required' => true));
        $expected = array('template' => '/{:controller}/{:action}', 'pattern' => '@^(?:/(?P<controller>[^\\/]+))(?:/(?P<action>[^\\/]+)?)?$@u', 'keys' => array('controller' => 'controller', 'action' => 'action'), 'params' => array('action' => 'view', 'required' => true), 'defaults' => array('action' => 'view'), 'match' => array('required' => true), 'meta' => array(), 'persist' => array('controller'), 'subPatterns' => array(), 'handler' => null);
        $this->assertEqual($expected, $result->export());
    }
RouterTest