public function all($scope = true)
{
$routes = Router::get(null, true);
$columns = array(array('Template', 'Params'), array('--------', '------'));
foreach ($routes as $route) {
$info = $route->export();
$columns[] = array($info['template'], json_encode($info['params']));
}
$this->columns($columns);
}
/** * Tests the "all" command with an env (production) param. * * Don't be confused if the expected output doesn't make sense here. We are * stripping the whitespace away so that this source code is easier to read. * Built-In methods are used for output formatting and are tested elsewhere. */ public function testAllWithEnvironment() { $request = new Request(); $request->params = array('env' => 'production'); $command = new Route(compact('request') + array('routes' => $this->_config['routes'], 'classes' => array('response' => 'lithium\\tests\\mocks\\console\\MockResponse'))); $command->all(); $expected = 'TemplateParams--------------'; $expected .= '/{"controller":"Pages","action":"view"}'; $expected .= '/pages/{:args}{"controller":"Pages","action":"view"}'; $this->assertEqual($this->_strip($expected), $this->_strip($command->response->output)); }