You are here

public function ApplicationTest::testVerboseValueNotBreakArguments 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::testVerboseValueNotBreakArguments()

Issue #9285.

If the "verbose" option is just before an argument in ArgvInput, an argument value should not be treated as verbosity value. This test will fail with "Not enough arguments." if broken

File

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

Class

ApplicationTest

Namespace

Symfony\Component\Console\Tests

Code

public function testVerboseValueNotBreakArguments() {
  $application = new Application();
  $application
    ->setAutoExit(false);
  $application
    ->setCatchExceptions(false);
  $application
    ->add(new \FooCommand());
  $output = new StreamOutput(fopen('php://memory', 'w', false));
  $input = new ArgvInput(array(
    'cli.php',
    '-v',
    'foo:bar',
  ));
  $application
    ->run($input, $output);
  $input = new ArgvInput(array(
    'cli.php',
    '--verbose',
    'foo:bar',
  ));
  $application
    ->run($input, $output);
}