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); }
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); }