Fixed tests

This commit is contained in:
Florin Patan 2013-04-11 22:38:29 +03:00 committed by Jordi Boggiano
parent b62d35feb9
commit 5bb41636bc
11 changed files with 24 additions and 34 deletions

View File

@ -184,14 +184,16 @@ class Application
if (true === $input->hasParameterOption(array('--quiet', '-q'))) {
$output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
} else {
if ($input->hasParameterOption('-vvv') || $input->hasParameterOption('--verbose=3')) {
} elseif($input->hasParameterOption('--verbose')) {
if ($input->hasParameterOption('-vvv') || $input->getParameterOption('--verbose') === 3) {
$output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
} elseif ($input->hasParameterOption('-vv') || $input->hasParameterOption('--verbose=2')) {
} elseif ($input->hasParameterOption('-vv') || $input->getParameterOption('--verbose') === 2) {
$output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE);
} elseif ($input->hasParameterOption('-v') || $input->hasParameterOption('--verbose=1') || $input->hasParameterOption('--verbose')) {
} else {
$output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
}
}elseif($input->hasParameterOption('-v')) {
$output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
}
if (true === $input->hasParameterOption(array('--version', '-V'))) {
@ -923,7 +925,7 @@ class Application
new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.'),
new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message.'),
new InputOption('--verbose', '-v', InputOption::VALUE_OPTIONAL, 'Increase verbosity of messages. Can be between 1 (normal, default), 2 (more verbose) and 3 (maximum)', 1),
new InputOption('--verbose', '-v', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'),
new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version.'),
new InputOption('--ansi', '', InputOption::VALUE_NONE, 'Force ANSI output.'),
new InputOption('--no-ansi', '', InputOption::VALUE_NONE, 'Disable ANSI output.'),

View File

@ -406,8 +406,8 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$application = new Application();
$application->add(new \FooCommand);
$this->ensureStaticCommandHelp($application);
$this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml1.txt', $application->asXml(), '->asXml(1) returns an XML representation of the application');
$this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml2.txt', $application->asXml('foo'), '->asXml(2) returns an XML representation of the application');
$this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml1.txt', $application->asXml(), '->asXml() returns an XML representation of the application');
$this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/application_asxml2.txt', $application->asXml('foo'), '->asXml() returns an XML representation of the application');
}
public function testRenderException()
@ -503,7 +503,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed');
$tester->run(array('command' => 'list', '--verbose' => 1));
$this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed');
$this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose=1 is passed');
$tester->run(array('command' => 'list', '--verbose' => 2));
$this->assertSame(Output::VERBOSITY_VERY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to very verbose if --verbose=2 is passed');

View File

@ -6,7 +6,7 @@
<comment>Options:</comment>
<info>--help</info> <info>-h</info> Display this help message.
<info>--quiet</info> <info>-q</info> Do not output any message.
<info>--verbose</info> <info>-v</info> Increase verbosity of messages. Can be between 1 (normal, default), 2 (more verbose) and 3 (maximum)
<info>--verbose</info> <info>-v</info> Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
<info>--version</info> <info>-V</info> Display this application version.
<info>--ansi</info> Force ANSI output.
<info>--no-ansi</info> Disable ANSI output.

View File

@ -6,7 +6,7 @@
<comment>Options:</comment>
<info>--help</info> <info>-h</info> Display this help message.
<info>--quiet</info> <info>-q</info> Do not output any message.
<info>--verbose</info> <info>-v</info> Increase verbosity of messages. Can be between 1 (normal, default), 2 (more verbose) and 3 (maximum)
<info>--verbose</info> <info>-v</info> Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
<info>--version</info> <info>-V</info> Display this application version.
<info>--ansi</info> Force ANSI output.
<info>--no-ansi</info> Disable ANSI output.

View File

@ -39,11 +39,8 @@
<option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
<description>Do not output any message.</description>
</option>
<option name="--verbose" shortcut="-v" accept_value="1" is_value_required="0" is_multiple="0">
<description>Increase verbosity of messages. Can be between 1 (normal, default), 2 (more verbose) and 3 (maximum)</description>
<defaults>
<default>1</default>
</defaults>
<option name="--verbose" shortcut="-v" accept_value="0" is_value_required="0" is_multiple="0">
<description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
</option>
<option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
<description>Display this application version.</description>
@ -112,11 +109,8 @@
<option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
<description>Do not output any message.</description>
</option>
<option name="--verbose" shortcut="-v" accept_value="1" is_value_required="0" is_multiple="0">
<description>Increase verbosity of messages. Can be between 1 (normal, default), 2 (more verbose) and 3 (maximum)</description>
<defaults>
<default>1</default>
</defaults>
<option name="--verbose" shortcut="-v" accept_value="0" is_value_required="0" is_multiple="0">
<description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
</option>
<option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
<description>Display this application version.</description>

View File

@ -16,11 +16,8 @@
<option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
<description>Do not output any message.</description>
</option>
<option name="--verbose" shortcut="-v" accept_value="1" is_value_required="0" is_multiple="0">
<description>Increase verbosity of messages. Can be between 1 (normal, default), 2 (more verbose) and 3 (maximum)</description>
<defaults>
<default>1</default>
</defaults>
<option name="--verbose" shortcut="-v" accept_value="0" is_value_required="0" is_multiple="0">
<description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
</option>
<option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
<description>Display this application version.</description>

View File

@ -6,7 +6,7 @@
<comment>Options:</comment>
<info>--help</info> <info>-h</info> Display this help message.
<info>--quiet</info> <info>-q</info> Do not output any message.
<info>--verbose</info> <info>-v</info> Increase verbosity of messages. Can be between 1 (normal, default), 2 (more verbose) and 3 (maximum)
<info>--verbose</info> <info>-v</info> Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
<info>--version</info> <info>-V</info> Display this application version.
<info>--ansi</info> Force ANSI output.
<info>--no-ansi</info> Disable ANSI output.

View File

@ -6,7 +6,7 @@ Usage:
Options:
--help -h Display this help message.
--quiet -q Do not output any message.
--verbose -v Increase verbosity of messages. Can be between 1 (normal, default), 2 (more verbose) and 3 (maximum)
--verbose -v Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
--version -V Display this application version.
--ansi Force ANSI output.
--no-ansi Disable ANSI output.

View File

@ -11,7 +11,7 @@ Options:
--raw To output raw command help
--help (-h) Display this help message.
--quiet (-q) Do not output any message.
--verbose (-v) Increase verbosity of messages. Can be between 1 (normal, default), 2 (more verbose) and 3 (maximum) (default: 1)
--verbose (-v) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
--version (-V) Display this application version.
--ansi Force ANSI output.
--no-ansi Disable ANSI output.

View File

@ -8,7 +8,7 @@
<comment>Options:</comment>
<info>--help</info> (-h) Display this help message.
<info>--quiet</info> (-q) Do not output any message.
<info>--verbose</info> (-v) Increase verbosity of messages. Can be between 1 (normal, default), 2 (more verbose) and 3 (maximum)<comment> (default: 1)</comment>
<info>--verbose</info> (-v) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
<info>--version</info> (-V) Display this application version.
<info>--ansi</info> Force ANSI output.
<info>--no-ansi</info> Disable ANSI output.

View File

@ -19,11 +19,8 @@
<option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
<description>Do not output any message.</description>
</option>
<option name="--verbose" shortcut="-v" accept_value="1" is_value_required="0" is_multiple="0">
<description>Increase verbosity of messages. Can be between 1 (normal, default), 2 (more verbose) and 3 (maximum)</description>
<defaults>
<default>1</default>
</defaults>
<option name="--verbose" shortcut="-v" accept_value="0" is_value_required="0" is_multiple="0">
<description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
</option>
<option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
<description>Display this application version.</description>