You are here

public function InputDefinitionTest::testLegacyAsText 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::testLegacyAsText()

@group legacy

File

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

Class

InputDefinitionTest

Namespace

Symfony\Component\Console\Tests\Input

Code

public function testLegacyAsText() {
  $definition = new InputDefinition(array(
    new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'),
    new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true),
    new InputArgument('bar', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'The bar argument', array(
      'http://foo.com/',
    )),
    new InputOption('foo', 'f', InputOption::VALUE_REQUIRED, 'The foo option'),
    new InputOption('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false),
    new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'),
    new InputOption('qux', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux option', array(
      'http://foo.com/',
      'bar',
    )),
    new InputOption('qux2', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux2 option', array(
      'foo' => 'bar',
    )),
  ));
  $this
    ->assertStringEqualsFile(self::$fixtures . '/definition_astext.txt', $definition
    ->asText(), '->asText() returns a textual representation of the InputDefinition');
}