$r->clearRoutes(); $r->connect('test', new sfRoute('/:module', array('action' => 'index'))); $r->connect('test1', new sfRoute('/:module/:action/*', array())); $routes = $r->getRoutes(); $r->clearRoutes(); $r->appendRoute('test', new sfRoute('/:module', array('action' => 'index'))); $r->appendRoute('test1', new sfRoute('/:module/:action/*', array())); $t->is($r->getRoutes(), $routes, '->appendRoute() is an alias for ->connect()'); // ->prependRoute() $t->diag('->prependRoute()'); $r->clearRoutes(); $r->connect('test', new sfRoute('/:module', array('action' => 'index'))); $r->connect('test1', new sfRoute('/:module/:action/*', array())); $route_names = array_keys($r->getRoutes()); $r->clearRoutes(); $r->prependRoute('test', new sfRoute('/:module', array('action' => 'index'))); $r->prependRoute('test1', new sfRoute('/:module/:action/*', array())); $p_route_names = array_keys($r->getRoutes()); $t->is(implode('-', $p_route_names), implode('-', array_reverse($route_names)), '->prependRoute() adds new routes at the beginning of the existings ones'); // ->addRouteBefore() $t->diag('->insertRouteBefore()'); $r->clearRoutes(); $r->connect('test1', new sfRoute('/:module', array('action' => 'index'))); $r->connect('test3', new sfRoute('/:module/:action/*', array())); $r->insertRouteBefore('test3', 'test2', new sfRoute('/:module/:action', array('module' => 'default'))); $route_names = array_keys($r->getRoutes()); $r->clearRoutes(); $r->connect('test1', new sfRoute('/:module', array('action' => 'index'))); $r->connect('test2', new sfRoute('/:module/:action', array('module' => 'default'))); $r->connect('test3', new sfRoute('/:module/:action/*', array())); $test_route_names = array_keys($r->getRoutes());