Inheritance: extends lithium\core\Object
Ejemplo n.º 1
0
 public function testParseWithParam()
 {
     $expected = array('command' => 'test', 'action' => 'action', 'args' => array(), 'i' => true);
     $result = Router::parse(new Request(array('args' => array('test', 'action', '-i'))));
     $this->assertEqual($expected, $result);
     $expected = array('command' => 'test', 'action' => 'action', 'args' => array('something'), 'i' => true);
     $result = Router::parse(new Request(array('args' => array('test', 'action', '-i', 'something'))));
     $this->assertEqual($expected, $result);
 }
Ejemplo n.º 2
0
 public function testParseGnuStyleLongOptionAsFirst()
 {
     $expected = array('command' => 'test', 'action' => 'action', 'long' => 'something', 'i' => true, 'args' => array());
     $result = Router::parse(new Request(array('args' => array('--long=something', 'test', 'action', '-i'))));
     $this->assertEqual($expected, $result);
 }