public function testBuildAnonymousArgsFormat() { $baseFormat = new ArgsFormat(); $this->config->setName('command'); $this->config->setShortName('c'); $this->config->setAliases(array('alias1', 'alias2')); $this->config->addOption('option'); $this->config->addArgument('argument'); $this->config->markAnonymous(); $expected = ArgsFormat::build($baseFormat)->addArgument(new Argument('argument'))->addOption(new Option('option'))->getFormat(); $this->assertEquals($expected, $this->config->buildArgsFormat($baseFormat)); }
public function testIgnoreDisabledSubCommands() { $config = new CommandConfig('command'); $config->addSubCommandConfig($subConfig1 = new SubCommandConfig('sub1')); $config->addSubCommandConfig($subConfig2 = new OptionCommandConfig('sub2')); $subConfig1->enable(); $subConfig2->disable(); $command = new Command($config, $this->application); $this->assertEquals(new CommandCollection(array('sub1' => new Command($subConfig1, $this->application, $command))), $command->getSubCommands()); }