$command->
addOption('foo',
['f'
], InputOption::VALUE_OPTIONAL, 'Description', 'default',
['a', 'b'
]);
$option =
$command->
getDefinition()->
getOption('foo'
);
$this->
assertSame('f',
$option->
getShortcut());
$this->
assertSame('Description',
$option->
getDescription());
$this->
assertSame('default',
$option->
getDefault());
$this->
assertTrue($option->
hasCompletion());
} public function testSetHidden() { $command =
new \
TestCommand();
$command->
setHidden();
$this->
assertTrue($command->
isHidden());
} public function testGetNamespaceGetNameSetName() { $command =
new \
TestCommand();
$this->
assertEquals('namespace:name',
$command->
getName(), '->getName() returns the command name'
);
$command->
setName('foo'
);
$this->
assertEquals('foo',
$command->
getName(), '->setName() sets the command name'
);
$ret =
$command->
setName('foobar:bar'
);