From f8240a9b3eac34cb0b8d5fa2b04690a6c6813f8c Mon Sep 17 00:00:00 2001 From: Kirill chEbba Chebunin Date: Fri, 22 Nov 2013 03:55:48 +0400 Subject: [PATCH] [Console] Add failing test for --verbose=X long option in argv --- .../Component/Console/Tests/ApplicationTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index aaa8cb48f3521..3f769acf224fa 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -623,6 +623,20 @@ public function testVerboseValueNotBreakArguments() $application->run($input, $output); } + public function testVerboseLongValueInArgv() + { + $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', '--verbose=3', 'foo:bar')); + $application->run($input, $output); + $this->assertEquals(Output::VERBOSITY_VERY_VERBOSE, $output->getVerbosity()); + } + public function testRunReturnsIntegerExitCode() { $exception = new \Exception('', 4);