$option =
new InputOption('foo', '-f|-ff|fff'
);
$this->
assertEquals('f|ff|fff',
$option->
getShortcut(), '__construct() removes the leading - of the shortcuts'
);
$option =
new InputOption('foo',
['f', 'ff', '-fff'
]);
$this->
assertEquals('f|ff|fff',
$option->
getShortcut(), '__construct() removes the leading - of the shortcuts'
);
$option =
new InputOption('foo'
);
$this->
assertNull($option->
getShortcut(), '__construct() makes the shortcut null by default'
);
} public function testModes() { $option =
new InputOption('foo', 'f'
);
$this->
assertFalse($option->
acceptValue(), '__construct() gives a "InputOption::VALUE_NONE" mode by default'
);
$this->
assertFalse($option->
isValueRequired(), '__construct() gives a "InputOption::VALUE_NONE" mode by default'
);
$this->
assertFalse($option->
isValueOptional(), '__construct() gives a "InputOption::VALUE_NONE" mode by default'
);
$option =
new InputOption('foo', 'f', null
);
$this->
assertFalse($option->
acceptValue(), '__construct() can take "InputOption::VALUE_NONE" as its mode'
);
$this->
assertFalse($option->
isValueRequired(), '__construct() can take "InputOption::VALUE_NONE" as its mode'
);
$this->
assertFalse($option->
isValueOptional(), '__construct() can take "InputOption::VALUE_NONE" as its mode'
);
$option =
new InputOption('foo', 'f', InputOption::VALUE_NONE
);
$this->
assertFalse($option->
acceptValue(), '__construct() can take "InputOption::VALUE_NONE" as its mode'
);
$this->
assertFalse($option->
isValueRequired(), '__construct() can take "InputOption::VALUE_NONE" as its mode'
);