You are here

public function InputDefinitionTest::getGetSynopsisData in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/console/Tests/Input/InputDefinitionTest.php \Symfony\Component\Console\Tests\Input\InputDefinitionTest::getGetSynopsisData()

File

vendor/symfony/console/Tests/Input/InputDefinitionTest.php, line 363

Class

InputDefinitionTest

Namespace

Symfony\Component\Console\Tests\Input

Code

public function getGetSynopsisData() {
  return array(
    array(
      new InputDefinition(array(
        new InputOption('foo'),
      )),
      '[--foo]',
      'puts optional options in square brackets',
    ),
    array(
      new InputDefinition(array(
        new InputOption('foo', 'f'),
      )),
      '[-f|--foo]',
      'separates shortcut with a pipe',
    ),
    array(
      new InputDefinition(array(
        new InputOption('foo', 'f', InputOption::VALUE_REQUIRED),
      )),
      '[-f|--foo FOO]',
      'uses shortcut as value placeholder',
    ),
    array(
      new InputDefinition(array(
        new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL),
      )),
      '[-f|--foo [FOO]]',
      'puts optional values in square brackets',
    ),
    array(
      new InputDefinition(array(
        new InputArgument('foo', InputArgument::REQUIRED),
      )),
      '<foo>',
      'puts arguments in angle brackets',
    ),
    array(
      new InputDefinition(array(
        new InputArgument('foo'),
      )),
      '[<foo>]',
      'puts optional arguments in square brackets',
    ),
    array(
      new InputDefinition(array(
        new InputArgument('foo', InputArgument::IS_ARRAY),
      )),
      '[<foo>]...',
      'uses an ellipsis for array arguments',
    ),
    array(
      new InputDefinition(array(
        new InputArgument('foo', InputArgument::REQUIRED | InputArgument::IS_ARRAY),
      )),
      '<foo> (<foo>)...',
      'uses parenthesis and ellipsis for required array arguments',
    ),
    array(
      new InputDefinition(array(
        new InputOption('foo'),
        new InputArgument('foo', InputArgument::REQUIRED),
      )),
      '[--foo] [--] <foo>',
      'puts [--] between options and arguments',
    ),
  );
}