public function getNames($includeAliases = false)
{
$names = array_keys($this->commands);
if ($includeAliases) {
$names = array_merge($names, array_keys($this->aliasIndex));
}
sort($names);
return $names;
}
public function testGetNamesWithAliases() { $ls = new Command(CommandConfig::create('ls')->addAlias('ls-alias')); $cd = new Command(CommandConfig::create('cd')->addAlias('cd-alias')); $this->collection->add($ls); $this->collection->add($cd); $this->assertSame(array('cd', 'cd-alias', 'ls', 'ls-alias'), $this->collection->getNames(true)); }