public function ApplicationTest::testSettingCustomInputDefinitionOverwritesDefaultValues in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/console/Tests/ApplicationTest.php \Symfony\Component\Console\Tests\ApplicationTest::testSettingCustomInputDefinitionOverwritesDefaultValues()
File
- vendor/
symfony/ console/ Tests/ ApplicationTest.php, line 851
Class
Namespace
Symfony\Component\Console\TestsCode
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'));
}