private static function findSubcommand($args) { $command = \Terminus::getRootCommand(); while (!empty($args) && $command && $command->canHaveSubcommands()) { $command = $command->findSubcommand($args); } return $command; }
public function testGetRootCommand() { $root_command = Terminus::getRootCommand(); $this->assertTrue(strpos(get_class($root_command), 'RootCommand') !== false); // Make sure the core commands have loaded $commands = array('art', 'auth', 'cli', 'drush', 'help', 'machine-tokens', 'organizations', 'site', 'sites', 'upstreams', 'workflows', 'wp'); foreach ($commands as $command) { $args = array($command); $this->assertTrue($root_command->findSubcommand($args) !== false); } // Make sure the correct number of parameters are configured. $desc = $root_command->getLongdesc(); $this->assertTrue(count($desc['parameters']) == 4); }
public function testGetPath() { $root_command = Terminus::getRootCommand(); $path = Dispatcher\getPath($root_command); $this->assertEquals($path, ['terminus']); }
/** * Dump the list of installed commands, as JSON. * * @subcommand cmd-dump */ function cmd_dump() { $this->output()->outputDump(self::command_to_array(Terminus::getRootCommand())); }
public function testGetRootCommand() { $root_command = Terminus::getRootCommand(); $this->assertTrue(strpos(get_class($root_command), 'RootCommand') !== false); }