Пример #1
0
 function test_should_parse_urls_with_format()
 {
     $controller = new Trails_Controller($this->dispatcher);
     $extractions = array('wiki/show/group' => array('wiki', array('show', 'group'), NULL), 'wiki/show/group.html' => array('wiki', array('show', 'group'), 'html'), '' => array('index', array(), NULL), 'wiki.json' => array('wiki', array(), 'json'), 'wiki' => array('wiki', array(), NULL), 'wiki/' => array('wiki', array(''), NULL), 'wiki///' => array('wiki', array('', '', ''), NULL), 'show/id-with-hyphen' => array('show', array('id-with-hyphen'), NULL), 'show/id-with-hyphen.html' => array('show', array('id-with-hyphen'), 'html'));
     foreach ($extractions as $url => $extraction) {
         $this->assertEqual($extraction, $controller->extract_action_and_args($url));
     }
 }