Extends
lithium\test\Unit
Tests generating routes with required parameters which are not present in the URL.
Source
public function testConnectingWithRequiredParams() {
$result = Router::connect('/{:controller}/{:action}', array(
'action' => 'view', 'required' => true
));
$expected = array(
'template' => '/{:controller}/{:action}',
'pattern' => '@^(?:/(?P<controller>[^\\/]+))(?:/(?P<action>[^\\/]+)?)?$@',
'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());
}