You are here

public function ApplicationTest::testSettingCustomInputDefinitionOverwritesDefaultValues in Zircon Profile 8

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

File

vendor/symfony/console/Tests/ApplicationTest.php, line 851

Class

ApplicationTest

Namespace

Symfony\Component\Console\Tests

Code

public function testSettingCustomInputDefinitionOverwritesDefaultValues() {
  $application = new Application();
  $application
    ->setAutoExit(false);
  $application
    ->setCatchExceptions(false);
  $application
    ->setDefinition(new InputDefinition(array(
    new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.'),
  )));
  $inputDefinition = $application
    ->getDefinition();

  // check whether the default arguments and options are not returned any more
  $this
    ->assertFalse($inputDefinition
    ->hasArgument('command'));
  $this
    ->assertFalse($inputDefinition
    ->hasOption('help'));
  $this
    ->assertFalse($inputDefinition
    ->hasOption('quiet'));
  $this
    ->assertFalse($inputDefinition
    ->hasOption('verbose'));
  $this
    ->assertFalse($inputDefinition
    ->hasOption('version'));
  $this
    ->assertFalse($inputDefinition
    ->hasOption('ansi'));
  $this
    ->assertFalse($inputDefinition
    ->hasOption('no-ansi'));
  $this
    ->assertFalse($inputDefinition
    ->hasOption('no-interaction'));
  $this
    ->assertTrue($inputDefinition
    ->hasOption('custom'));
}