You are here

public function InputDefinitionTest::testGetOptionDefaults in Zircon Profile 8

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

File

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

Class

InputDefinitionTest

Namespace

Symfony\Component\Console\Tests\Input

Code

public function testGetOptionDefaults() {
  $definition = new InputDefinition(array(
    new InputOption('foo1', null, InputOption::VALUE_NONE),
    new InputOption('foo2', null, InputOption::VALUE_REQUIRED),
    new InputOption('foo3', null, InputOption::VALUE_REQUIRED, '', 'default'),
    new InputOption('foo4', null, InputOption::VALUE_OPTIONAL),
    new InputOption('foo5', null, InputOption::VALUE_OPTIONAL, '', 'default'),
    new InputOption('foo6', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY),
    new InputOption('foo7', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, '', array(
      1,
      2,
    )),
  ));
  $defaults = array(
    'foo1' => false,
    'foo2' => null,
    'foo3' => 'default',
    'foo4' => null,
    'foo5' => 'default',
    'foo6' => array(),
    'foo7' => array(
      1,
      2,
    ),
  );
  $this
    ->assertSame($defaults, $definition
    ->getOptionDefaults(), '->getOptionDefaults() returns the default values for all options');
}