public function testBooleanWithOptional() { $this->
expectException(\InvalidArgumentException::
class);
$this->
expectExceptionMessage('Impossible to have an option mode VALUE_NEGATABLE if the option also accepts a value.'
);
new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL | InputOption::VALUE_NEGATABLE
);
} public function testShortcut() { $option =
new InputOption('foo', 'f'
);
$this->
assertEquals('f',
$option->
getShortcut(), '__construct() can take a shortcut as its second argument'
);
$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'
);