setCommandOptions() public method

Any existing command options are removed when this method is called.
See also: addCommandOption()
public setCommandOptions ( array $commandOptions ) : static
$commandOptions array The command options of the built format.
return static The current instance.
 public function testSetCommandOptions()
 {
     $this->builder->addCommandOption($option1 = new CommandOption('option1'));
     $this->builder->setCommandOptions(array($option2 = new CommandOption('option2'), $option3 = new CommandOption('option3')));
     $this->assertSame(array($option2, $option3), $this->builder->getCommandOptions());
 }