summaryrefslogtreecommitdiff
path: root/vendor/symfony/console/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/console/Tests')
-rw-r--r--vendor/symfony/console/Tests/ApplicationTest.php736
-rw-r--r--vendor/symfony/console/Tests/Command/CommandTest.php117
-rw-r--r--vendor/symfony/console/Tests/Command/HelpCommandTest.php5
-rw-r--r--vendor/symfony/console/Tests/Command/ListCommandTest.php5
-rw-r--r--vendor/symfony/console/Tests/Command/LockableTraitTest.php67
-rw-r--r--vendor/symfony/console/Tests/CommandLoader/ContainerCommandLoaderTest.php61
-rw-r--r--vendor/symfony/console/Tests/CommandLoader/FactoryCommandLoaderTest.php60
-rw-r--r--vendor/symfony/console/Tests/DependencyInjection/AddConsoleCommandPassTest.php187
-rw-r--r--vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php9
-rw-r--r--vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php4
-rw-r--r--vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php18
-rw-r--r--vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php5
-rw-r--r--vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php26
-rw-r--r--vendor/symfony/console/Tests/EventListener/ErrorListenerTest.php156
-rw-r--r--vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.php2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/DescriptorApplicationMbString.php24
-rw-r--r--vendor/symfony/console/Tests/Fixtures/DescriptorCommand3.php27
-rw-r--r--vendor/symfony/console/Tests/Fixtures/DescriptorCommand4.php25
-rw-r--r--vendor/symfony/console/Tests/Fixtures/DescriptorCommandMbString.php32
-rw-r--r--vendor/symfony/console/Tests/Fixtures/DummyOutput.php2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Foo3Command.php2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/FooLock2Command.php28
-rw-r--r--vendor/symfony/console/Tests/Fixtures/FooLockCommand.php27
-rw-r--r--vendor/symfony/console/Tests/Fixtures/FooOptCommand.php36
-rw-r--r--vendor/symfony/console/Tests/Fixtures/FooSameCaseLowercaseCommand.php11
-rw-r--r--vendor/symfony/console/Tests/Fixtures/FooSameCaseUppercaseCommand.php11
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_0.php4
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_1.php4
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_10.php4
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php11
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_12.php13
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_13.php14
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_14.php17
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_15.php14
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_16.php15
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_17.php13
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php4
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_3.php4
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4.php4
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php6
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_6.php4
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_7.php4
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_8.php4
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_9.php4
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/interactive_command_1.php19
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/interactive_output_1.txt7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_11.txt6
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_12.txt6
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_13.txt7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_14.txt6
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_15.txt7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_16.txt8
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_17.txt7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_1.json157
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_1.md165
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_1.txt2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_1.xml14
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_2.json510
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_2.md397
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_2.txt7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_2.xml88
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_asxml1.txt146
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_asxml2.txt37
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_filtered_namespace.txt (renamed from vendor/symfony/console/Tests/Fixtures/application_astext2.txt)6
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_gethelp.txt2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_mbstring.md269
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_mbstring.txt (renamed from vendor/symfony/console/Tests/Fixtures/application_astext1.txt)11
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt18
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt20
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1.txt2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception_escapeslines.txt9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception_linebreaks.txt11
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_run2.txt41
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_run3.txt31
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_1.json16
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_1.md15
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_1.txt2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_1.xml2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_2.json34
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_2.md28
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_2.txt8
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_2.xml2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_astext.txt18
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_asxml.txt38
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_mbstring.md29
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_mbstring.txt13
-rw-r--r--vendor/symfony/console/Tests/Fixtures/definition_astext.txt11
-rw-r--r--vendor/symfony/console/Tests/Fixtures/definition_asxml.txt39
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_1.json8
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_1.md4
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_2.json8
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_2.md6
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_3.json8
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_3.md6
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_4.json8
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_4.md8
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_4.txt2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.json7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.md7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.xml7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_with_style.json7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_with_style.md7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_with_style.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_with_style.xml7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_1.json5
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_2.json13
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_2.md6
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_3.json15
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_3.md7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_4.json23
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_4.md13
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_1.json10
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_1.md5
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_2.json10
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_2.md7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_3.json10
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_3.md7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_4.json10
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_4.md7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_5.json10
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_5.md9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_5.txt2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_6.json10
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_6.md7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.json9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.md8
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.xml7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_with_style.json9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_with_style.md8
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_with_style.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_with_style.xml7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.json12
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.md8
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.xml8
-rw-r--r--vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php3
-rw-r--r--vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php7
-rw-r--r--vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php73
-rw-r--r--vendor/symfony/console/Tests/Helper/AbstractQuestionHelperTest.php34
-rw-r--r--vendor/symfony/console/Tests/Helper/FormatterHelperTest.php39
-rw-r--r--vendor/symfony/console/Tests/Helper/HelperSetTest.php12
-rw-r--r--vendor/symfony/console/Tests/Helper/HelperTest.php3
-rw-r--r--vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php263
-rw-r--r--vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php224
-rw-r--r--vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php316
-rw-r--r--vendor/symfony/console/Tests/Helper/ProcessHelperTest.php21
-rw-r--r--vendor/symfony/console/Tests/Helper/ProgressBarTest.php240
-rw-r--r--vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php13
-rw-r--r--vendor/symfony/console/Tests/Helper/QuestionHelperTest.php599
-rw-r--r--vendor/symfony/console/Tests/Helper/SymfonyQuestionHelperTest.php156
-rw-r--r--vendor/symfony/console/Tests/Helper/TableStyleTest.php3
-rw-r--r--vendor/symfony/console/Tests/Helper/TableTest.php271
-rw-r--r--vendor/symfony/console/Tests/Input/ArgvInputTest.php125
-rw-r--r--vendor/symfony/console/Tests/Input/ArrayInputTest.php42
-rw-r--r--vendor/symfony/console/Tests/Input/InputArgumentTest.php10
-rw-r--r--vendor/symfony/console/Tests/Input/InputDefinitionTest.php43
-rw-r--r--vendor/symfony/console/Tests/Input/InputOptionTest.php10
-rw-r--r--vendor/symfony/console/Tests/Input/InputTest.php19
-rw-r--r--vendor/symfony/console/Tests/Input/StringInputTest.php16
-rw-r--r--vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php165
-rw-r--r--vendor/symfony/console/Tests/Output/ConsoleOutputTest.php19
-rw-r--r--vendor/symfony/console/Tests/Output/NullOutputTest.php51
-rw-r--r--vendor/symfony/console/Tests/Output/OutputTest.php3
-rw-r--r--vendor/symfony/console/Tests/Output/StreamOutputTest.php3
-rw-r--r--vendor/symfony/console/Tests/Style/SymfonyStyleTest.php81
-rw-r--r--vendor/symfony/console/Tests/TerminalTest.php44
-rw-r--r--vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php3
-rw-r--r--vendor/symfony/console/Tests/Tester/CommandTesterTest.php81
175 files changed, 5410 insertions, 2075 deletions
diff --git a/vendor/symfony/console/Tests/ApplicationTest.php b/vendor/symfony/console/Tests/ApplicationTest.php
index 927fa0bd..4e1f8811 100644
--- a/vendor/symfony/console/Tests/ApplicationTest.php
+++ b/vendor/symfony/console/Tests/ApplicationTest.php
@@ -11,7 +11,11 @@
namespace Symfony\Component\Console\Tests;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\CommandLoader\FactoryCommandLoader;
+use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Helper\FormatterHelper;
use Symfony\Component\Console\Input\ArgvInput;
@@ -26,11 +30,14 @@ use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\StreamOutput;
use Symfony\Component\Console\Tester\ApplicationTester;
use Symfony\Component\Console\Event\ConsoleCommandEvent;
+use Symfony\Component\Console\Event\ConsoleErrorEvent;
use Symfony\Component\Console\Event\ConsoleExceptionEvent;
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
+use Symfony\Component\Console\Exception\CommandNotFoundException;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\EventDispatcher\EventDispatcher;
-class ApplicationTest extends \PHPUnit_Framework_TestCase
+class ApplicationTest extends TestCase
{
protected static $fixturesPath;
@@ -38,11 +45,14 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
{
self::$fixturesPath = realpath(__DIR__.'/Fixtures/');
require_once self::$fixturesPath.'/FooCommand.php';
+ require_once self::$fixturesPath.'/FooOptCommand.php';
require_once self::$fixturesPath.'/Foo1Command.php';
require_once self::$fixturesPath.'/Foo2Command.php';
require_once self::$fixturesPath.'/Foo3Command.php';
require_once self::$fixturesPath.'/Foo4Command.php';
require_once self::$fixturesPath.'/Foo5Command.php';
+ require_once self::$fixturesPath.'/FooSameCaseUppercaseCommand.php';
+ require_once self::$fixturesPath.'/FooSameCaseLowercaseCommand.php';
require_once self::$fixturesPath.'/FoobarCommand.php';
require_once self::$fixturesPath.'/BarBucCommand.php';
require_once self::$fixturesPath.'/FooSubnamespaced1Command.php';
@@ -91,7 +101,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
public function testGetLongVersion()
{
$application = new Application('foo', 'bar');
- $this->assertEquals('<info>foo</info> version <comment>bar</comment>', $application->getLongVersion(), '->getLongVersion() returns the long version of the application');
+ $this->assertEquals('foo <info>bar</info>', $application->getLongVersion(), '->getLongVersion() returns the long version of the application');
}
public function testHelp()
@@ -111,6 +121,25 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertCount(1, $commands, '->all() takes a namespace as its first argument');
}
+ public function testAllWithCommandLoader()
+ {
+ $application = new Application();
+ $commands = $application->all();
+ $this->assertInstanceOf('Symfony\\Component\\Console\\Command\\HelpCommand', $commands['help'], '->all() returns the registered commands');
+
+ $application->add(new \FooCommand());
+ $commands = $application->all('foo');
+ $this->assertCount(1, $commands, '->all() takes a namespace as its first argument');
+
+ $application->setCommandLoader(new FactoryCommandLoader(array(
+ 'foo:bar1' => function () { return new \Foo1Command(); },
+ )));
+ $commands = $application->all('foo');
+ $this->assertCount(2, $commands, '->all() takes a namespace as its first argument');
+ $this->assertInstanceOf(\FooCommand::class, $commands['foo:bar'], '->all() returns the registered commands');
+ $this->assertInstanceOf(\Foo1Command::class, $commands['foo:bar1'], '->all() returns the registered commands');
+ }
+
public function testRegister()
{
$application = new Application();
@@ -163,6 +192,30 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf('Symfony\Component\Console\Command\HelpCommand', $command, '->get() returns the help command if --help is provided as the input');
}
+ public function testHasGetWithCommandLoader()
+ {
+ $application = new Application();
+ $this->assertTrue($application->has('list'), '->has() returns true if a named command is registered');
+ $this->assertFalse($application->has('afoobar'), '->has() returns false if a named command is not registered');
+
+ $application->add($foo = new \FooCommand());
+ $this->assertTrue($application->has('afoobar'), '->has() returns true if an alias is registered');
+ $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns a command by name');
+ $this->assertEquals($foo, $application->get('afoobar'), '->get() returns a command by alias');
+
+ $application->setCommandLoader(new FactoryCommandLoader(array(
+ 'foo:bar1' => function () { return new \Foo1Command(); },
+ )));
+
+ $this->assertTrue($application->has('afoobar'), '->has() returns true if an instance is registered for an alias even with command loader');
+ $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns an instance by name even with command loader');
+ $this->assertEquals($foo, $application->get('afoobar'), '->get() returns an instance by alias even with command loader');
+ $this->assertTrue($application->has('foo:bar1'), '->has() returns true for commands registered in the loader');
+ $this->assertInstanceOf(\Foo1Command::class, $foo1 = $application->get('foo:bar1'), '->get() returns a command by name from the command loader');
+ $this->assertTrue($application->has('afoobar1'), '->has() returns true for commands registered in the loader');
+ $this->assertEquals($foo1, $application->get('afoobar1'), '->get() returns a command by name from the command loader');
+ }
+
public function testSilentHelp()
{
$application = new Application();
@@ -176,7 +229,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException
+ * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
* @expectedExceptionMessage The command "foofoo" does not exist.
*/
public function testGetInvalidCommand()
@@ -211,21 +264,27 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns commands even if the commands are only contained in subnamespaces');
}
- /**
- * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException
- * @expectedExceptionMessage The namespace "f" is ambiguous (foo, foo1).
- */
public function testFindAmbiguousNamespace()
{
$application = new Application();
$application->add(new \BarBucCommand());
$application->add(new \FooCommand());
$application->add(new \Foo2Command());
+
+ $expectedMsg = "The namespace \"f\" is ambiguous.\nDid you mean one of these?\n foo\n foo1";
+
+ if (method_exists($this, 'expectException')) {
+ $this->expectException(CommandNotFoundException::class);
+ $this->expectExceptionMessage($expectedMsg);
+ } else {
+ $this->setExpectedException(CommandNotFoundException::class, $expectedMsg);
+ }
+
$application->findNamespace('f');
}
/**
- * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException
+ * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
* @expectedExceptionMessage There are no commands defined in the "bar" namespace.
*/
public function testFindInvalidNamespace()
@@ -235,7 +294,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException
+ * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
* @expectedExceptionMessage Command "foo1" is not defined
*/
public function testFindUniqueNameButNamespaceName()
@@ -260,12 +319,66 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf('FooCommand', $application->find('a'), '->find() returns a command if the abbreviation exists for an alias');
}
+ public function testFindCaseSensitiveFirst()
+ {
+ $application = new Application();
+ $application->add(new \FooSameCaseUppercaseCommand());
+ $application->add(new \FooSameCaseLowercaseCommand());
+
+ $this->assertInstanceOf('FooSameCaseUppercaseCommand', $application->find('f:B'), '->find() returns a command if the abbreviation is the correct case');
+ $this->assertInstanceOf('FooSameCaseUppercaseCommand', $application->find('f:BAR'), '->find() returns a command if the abbreviation is the correct case');
+ $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('f:b'), '->find() returns a command if the abbreviation is the correct case');
+ $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('f:bar'), '->find() returns a command if the abbreviation is the correct case');
+ }
+
+ public function testFindCaseInsensitiveAsFallback()
+ {
+ $application = new Application();
+ $application->add(new \FooSameCaseLowercaseCommand());
+
+ $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('f:b'), '->find() returns a command if the abbreviation is the correct case');
+ $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('f:B'), '->find() will fallback to case insensitivity');
+ $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('FoO:BaR'), '->find() will fallback to case insensitivity');
+ }
+
+ /**
+ * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
+ * @expectedExceptionMessage Command "FoO:BaR" is ambiguous
+ */
+ public function testFindCaseInsensitiveSuggestions()
+ {
+ $application = new Application();
+ $application->add(new \FooSameCaseLowercaseCommand());
+ $application->add(new \FooSameCaseUppercaseCommand());
+
+ $this->assertInstanceOf('FooSameCaseLowercaseCommand', $application->find('FoO:BaR'), '->find() will find two suggestions with case insensitivity');
+ }
+
+ public function testFindWithCommandLoader()
+ {
+ $application = new Application();
+ $application->setCommandLoader(new FactoryCommandLoader(array(
+ 'foo:bar' => $f = function () { return new \FooCommand(); },
+ )));
+
+ $this->assertInstanceOf('FooCommand', $application->find('foo:bar'), '->find() returns a command if its name exists');
+ $this->assertInstanceOf('Symfony\Component\Console\Command\HelpCommand', $application->find('h'), '->find() returns a command if its name exists');
+ $this->assertInstanceOf('FooCommand', $application->find('f:bar'), '->find() returns a command if the abbreviation for the namespace exists');
+ $this->assertInstanceOf('FooCommand', $application->find('f:b'), '->find() returns a command if the abbreviation for the namespace and the command name exist');
+ $this->assertInstanceOf('FooCommand', $application->find('a'), '->find() returns a command if the abbreviation exists for an alias');
+ }
+
/**
* @dataProvider provideAmbiguousAbbreviations
*/
public function testFindWithAmbiguousAbbreviations($abbreviation, $expectedExceptionMessage)
{
- $this->setExpectedException('Symfony\Component\Console\Exception\CommandNotFoundException', $expectedExceptionMessage);
+ if (method_exists($this, 'expectException')) {
+ $this->expectException('Symfony\Component\Console\Exception\CommandNotFoundException');
+ $this->expectExceptionMessage($expectedExceptionMessage);
+ } else {
+ $this->setExpectedException('Symfony\Component\Console\Exception\CommandNotFoundException', $expectedExceptionMessage);
+ }
$application = new Application();
$application->add(new \FooCommand());
@@ -279,8 +392,20 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
{
return array(
array('f', 'Command "f" is not defined.'),
- array('a', 'Command "a" is ambiguous (afoobar, afoobar1 and 1 more).'),
- array('foo:b', 'Command "foo:b" is ambiguous (foo:bar, foo:bar1 and 1 more).'),
+ array(
+ 'a',
+ "Command \"a\" is ambiguous.\nDid you mean one of these?\n".
+ " afoobar The foo:bar command\n".
+ " afoobar1 The foo:bar1 command\n".
+ ' afoobar2 The foo1:bar command',
+ ),
+ array(
+ 'foo:b',
+ "Command \"foo:b\" is ambiguous.\nDid you mean one of these?\n".
+ " foo:bar The foo:bar command\n".
+ " foo:bar1 The foo:bar1 command\n".
+ ' foo1:bar The foo1:bar command',
+ ),
);
}
@@ -313,7 +438,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
/**
* @dataProvider provideInvalidCommandNamesSingle
- * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException
+ * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
* @expectedExceptionMessage Did you mean this
*/
public function testFindAlternativeExceptionMessageSingle($name)
@@ -326,8 +451,8 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
public function provideInvalidCommandNamesSingle()
{
return array(
- array('foo3:baR'),
- array('foO3:bar'),
+ array('foo3:barr'),
+ array('fooo3:bar'),
);
}
@@ -425,7 +550,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$application->add(new \FooCommand());
$application->add(new \Foo1Command());
$application->add(new \Foo2Command());
- $application->add(new \foo3Command());
+ $application->add(new \Foo3Command());
try {
$application->find('Unknown-namespace:Unknown-command');
@@ -452,9 +577,39 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
}
}
+ public function testFindAlternativesOutput()
+ {
+ $application = new Application();
+
+ $application->add(new \FooCommand());
+ $application->add(new \Foo1Command());
+ $application->add(new \Foo2Command());
+ $application->add(new \Foo3Command());
+
+ $expectedAlternatives = array(
+ 'afoobar',
+ 'afoobar1',
+ 'afoobar2',
+ 'foo1:bar',
+ 'foo3:bar',
+ 'foo:bar',
+ 'foo:bar1',
+ );
+
+ try {
+ $application->find('foo');
+ $this->fail('->find() throws a CommandNotFoundException if command is not defined');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command is not defined');
+ $this->assertSame($expectedAlternatives, $e->getAlternatives());
+
+ $this->assertRegExp('/Command "foo" is not defined\..*Did you mean one of these\?.*/Ums', $e->getMessage());
+ }
+ }
+
public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces()
{
- $application = $this->getMock('Symfony\Component\Console\Application', array('getNamespaces'));
+ $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getNamespaces'))->getMock();
$application->expects($this->once())
->method('getNamespaces')
->will($this->returnValue(array('foo:sublong', 'bar:sub')));
@@ -463,7 +618,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException
+ * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
* @expectedExceptionMessage Command "foo::bar" is not defined.
*/
public function testFindWithDoubleColonInNameThrowsException()
@@ -476,17 +631,21 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
public function testSetCatchExceptions()
{
- $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
+ $application = new Application();
$application->setAutoExit(false);
- $application->expects($this->any())
- ->method('getTerminalWidth')
- ->will($this->returnValue(120));
+ putenv('COLUMNS=120');
$tester = new ApplicationTester($application);
$application->setCatchExceptions(true);
+ $this->assertTrue($application->areExceptionsCaught());
+
$tester->run(array('command' => 'foo'), array('decorated' => false));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getDisplay(true), '->setCatchExceptions() sets the catch exception flag');
+ $tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getErrorOutput(true), '->setCatchExceptions() sets the catch exception flag');
+ $this->assertSame('', $tester->getDisplay(true));
+
$application->setCatchExceptions(false);
try {
$tester->run(array('command' => 'foo'), array('decorated' => false));
@@ -497,96 +656,114 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
}
}
- /**
- * @group legacy
- */
- public function testLegacyAsText()
+ public function testAutoExitSetting()
{
$application = new Application();
- $application->add(new \FooCommand());
- $this->ensureStaticCommandHelp($application);
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext1.txt', $this->normalizeLineBreaks($application->asText()), '->asText() returns a text representation of the application');
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_astext2.txt', $this->normalizeLineBreaks($application->asText('foo')), '->asText() returns a text representation of the application');
- }
+ $this->assertTrue($application->isAutoExitEnabled());
- /**
- * @group legacy
- */
- public function testLegacyAsXml()
- {
- $application = new Application();
- $application->add(new \FooCommand());
- $this->ensureStaticCommandHelp($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');
+ $application->setAutoExit(false);
+ $this->assertFalse($application->isAutoExitEnabled());
}
public function testRenderException()
{
- $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
+ $application = new Application();
$application->setAutoExit(false);
- $application->expects($this->any())
- ->method('getTerminalWidth')
- ->will($this->returnValue(120));
+ putenv('COLUMNS=120');
$tester = new ApplicationTester($application);
- $tester->run(array('command' => 'foo'), array('decorated' => false));
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getDisplay(true), '->renderException() renders a pretty exception');
+ $tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exception');
- $tester->run(array('command' => 'foo'), array('decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE));
- $this->assertContains('Exception trace', $tester->getDisplay(), '->renderException() renders a pretty exception with a stack trace when verbosity is verbose');
+ $tester->run(array('command' => 'foo'), array('decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE, 'capture_stderr_separately' => true));
+ $this->assertContains('Exception trace', $tester->getErrorOutput(), '->renderException() renders a pretty exception with a stack trace when verbosity is verbose');
- $tester->run(array('command' => 'list', '--foo' => true), array('decorated' => false));
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception2.txt', $tester->getDisplay(true), '->renderException() renders the command synopsis when an exception occurs in the context of a command');
+ $tester->run(array('command' => 'list', '--foo' => true), array('decorated' => false, 'capture_stderr_separately' => true));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception2.txt', $tester->getErrorOutput(true), '->renderException() renders the command synopsis when an exception occurs in the context of a command');
$application->add(new \Foo3Command());
$tester = new ApplicationTester($application);
- $tester->run(array('command' => 'foo3:bar'), array('decorated' => false));
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions');
+ $tester->run(array('command' => 'foo3:bar'), array('decorated' => false, 'capture_stderr_separately' => true));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
+
+ $tester->run(array('command' => 'foo3:bar'), array('decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE));
+ $this->assertRegExp('/\[Exception\]\s*First exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is default and verbosity is verbose');
+ $this->assertRegExp('/\[Exception\]\s*Second exception/', $tester->getDisplay(), '->renderException() renders a pretty exception without code exception when code exception is 0 and verbosity is verbose');
+ $this->assertRegExp('/\[Exception \(404\)\]\s*Third exception/', $tester->getDisplay(), '->renderException() renders a pretty exception with code exception when code exception is 404 and verbosity is verbose');
$tester->run(array('command' => 'foo3:bar'), array('decorated' => true));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3decorated.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions');
- $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
+ $tester->run(array('command' => 'foo3:bar'), array('decorated' => true, 'capture_stderr_separately' => true));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception3decorated.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
+
+ $application = new Application();
$application->setAutoExit(false);
- $application->expects($this->any())
- ->method('getTerminalWidth')
- ->will($this->returnValue(32));
+ putenv('COLUMNS=32');
$tester = new ApplicationTester($application);
- $tester->run(array('command' => 'foo'), array('decorated' => false));
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception4.txt', $tester->getDisplay(true), '->renderException() wraps messages when they are bigger than the terminal');
+ $tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception4.txt', $tester->getErrorOutput(true), '->renderException() wraps messages when they are bigger than the terminal');
+ putenv('COLUMNS=120');
}
public function testRenderExceptionWithDoubleWidthCharacters()
{
- $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
+ $application = new Application();
$application->setAutoExit(false);
- $application->expects($this->any())
- ->method('getTerminalWidth')
- ->will($this->returnValue(120));
+ putenv('COLUMNS=120');
$application->register('foo')->setCode(function () {
throw new \Exception('エラーメッセージ');
});
$tester = new ApplicationTester($application);
- $tester->run(array('command' => 'foo'), array('decorated' => false));
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth1.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions');
+ $tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth1.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
+
+ $tester->run(array('command' => 'foo'), array('decorated' => true, 'capture_stderr_separately' => true));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth1decorated.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
+
+ $application = new Application();
+ $application->setAutoExit(false);
+ putenv('COLUMNS=32');
+ $application->register('foo')->setCode(function () {
+ throw new \Exception('コマンドの実行中にエラーが発生しました。');
+ });
+ $tester = new ApplicationTester($application);
+ $tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth2.txt', $tester->getErrorOutput(true), '->renderException() wraps messages when they are bigger than the terminal');
+ putenv('COLUMNS=120');
+ }
+
+ public function testRenderExceptionEscapesLines()
+ {
+ $application = new Application();
+ $application->setAutoExit(false);
+ putenv('COLUMNS=22');
+ $application->register('foo')->setCode(function () {
+ throw new \Exception('dont break here <info>!</info>');
+ });
+ $tester = new ApplicationTester($application);
- $tester->run(array('command' => 'foo'), array('decorated' => true));
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth1decorated.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions');
+ $tester->run(array('command' => 'foo'), array('decorated' => false));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_escapeslines.txt', $tester->getDisplay(true), '->renderException() escapes lines containing formatting');
+ putenv('COLUMNS=120');
+ }
- $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
+ public function testRenderExceptionLineBreaks()
+ {
+ $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock();
$application->setAutoExit(false);
$application->expects($this->any())
->method('getTerminalWidth')
- ->will($this->returnValue(32));
+ ->will($this->returnValue(120));
$application->register('foo')->setCode(function () {
- throw new \Exception('コマンドの実行中にエラーが発生しました。');
+ throw new \InvalidArgumentException("\n\nline 1 with extra spaces \nline 2\n\nline 4\n");
});
$tester = new ApplicationTester($application);
+
$tester->run(array('command' => 'foo'), array('decorated' => false));
- $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth2.txt', $tester->getDisplay(true), '->renderException() wraps messages when they are bigger than the terminal');
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_linebreaks.txt', $tester->getDisplay(true), '->renderException() keep multiple line breaks');
}
public function testRun()
@@ -640,9 +817,11 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$tester->run(array('command' => 'list', '--quiet' => true));
$this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed');
+ $this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if --quiet is passed');
$tester->run(array('command' => 'list', '-q' => true));
$this->assertSame('', $tester->getDisplay(), '->run() removes all output if -q is passed');
+ $this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if -q is passed');
$tester->run(array('command' => 'list', '--verbose' => true));
$this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed');
@@ -700,19 +879,23 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$input = new ArgvInput(array('cli.php', '-v', 'foo:bar'));
$application->run($input, $output);
+ $this->addToAssertionCount(1);
+
$input = new ArgvInput(array('cli.php', '--verbose', 'foo:bar'));
$application->run($input, $output);
+
+ $this->addToAssertionCount(1);
}
public function testRunReturnsIntegerExitCode()
{
$exception = new \Exception('', 4);
- $application = $this->getMock('Symfony\Component\Console\Application', array('doRun'));
+ $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('doRun'))->getMock();
$application->setAutoExit(false);
$application->expects($this->once())
- ->method('doRun')
- ->will($this->throwException($exception));
+ ->method('doRun')
+ ->will($this->throwException($exception));
$exitCode = $application->run(new ArrayInput(array()), new NullOutput());
@@ -723,11 +906,11 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
{
$exception = new \Exception('', 0);
- $application = $this->getMock('Symfony\Component\Console\Application', array('doRun'));
+ $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('doRun'))->getMock();
$application->setAutoExit(false);
$application->expects($this->once())
- ->method('doRun')
- ->will($this->throwException($exception));
+ ->method('doRun')
+ ->will($this->throwException($exception));
$exitCode = $application->run(new ArrayInput(array()), new NullOutput());
@@ -799,8 +982,6 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$helperSet = $application->getHelperSet();
$this->assertTrue($helperSet->has('formatter'));
- $this->assertTrue($helperSet->has('dialog'));
- $this->assertTrue($helperSet->has('progress'));
}
public function testAddingSingleHelperSetOverwritesDefaultValues()
@@ -919,7 +1100,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
/**
* @expectedException \LogicException
- * @expectedExceptionMessage caught
+ * @expectedExceptionMessage error
*/
public function testRunWithExceptionAndDispatcher()
{
@@ -950,7 +1131,212 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$tester = new ApplicationTester($application);
$tester->run(array('command' => 'foo'));
- $this->assertContains('before.foo.caught.after.', $tester->getDisplay());
+ $this->assertContains('before.foo.error.after.', $tester->getDisplay());
+ }
+
+ public function testRunDispatchesAllEventsWithExceptionInListener()
+ {
+ $dispatcher = $this->getDispatcher();
+ $dispatcher->addListener('console.command', function () {
+ throw new \RuntimeException('foo');
+ });
+
+ $application = new Application();
+ $application->setDispatcher($dispatcher);
+ $application->setAutoExit(false);
+
+ $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
+ $output->write('foo.');
+ });
+
+ $tester = new ApplicationTester($application);
+ $tester->run(array('command' => 'foo'));
+ $this->assertContains('before.error.after.', $tester->getDisplay());
+ }
+
+ /**
+ * @requires PHP 7
+ */
+ public function testRunWithError()
+ {
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+
+ $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) {
+ $output->write('dym.');
+
+ throw new \Error('dymerr');
+ });
+
+ $tester = new ApplicationTester($application);
+
+ try {
+ $tester->run(array('command' => 'dym'));
+ $this->fail('Error expected.');
+ } catch (\Error $e) {
+ $this->assertSame('dymerr', $e->getMessage());
+ }
+ }
+
+ public function testRunAllowsErrorListenersToSilenceTheException()
+ {
+ $dispatcher = $this->getDispatcher();
+ $dispatcher->addListener('console.error', function (ConsoleErrorEvent $event) {
+ $event->getOutput()->write('silenced.');
+
+ $event->setExitCode(0);
+ });
+
+ $dispatcher->addListener('console.command', function () {
+ throw new \RuntimeException('foo');
+ });
+
+ $application = new Application();
+ $application->setDispatcher($dispatcher);
+ $application->setAutoExit(false);
+
+ $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
+ $output->write('foo.');
+ });
+
+ $tester = new ApplicationTester($application);
+ $tester->run(array('command' => 'foo'));
+ $this->assertContains('before.error.silenced.after.', $tester->getDisplay());
+ $this->assertEquals(ConsoleCommandEvent::RETURN_CODE_DISABLED, $tester->getStatusCode());
+ }
+
+ public function testConsoleErrorEventIsTriggeredOnCommandNotFound()
+ {
+ $dispatcher = new EventDispatcher();
+ $dispatcher->addListener('console.error', function (ConsoleErrorEvent $event) {
+ $this->assertNull($event->getCommand());
+ $this->assertInstanceOf(CommandNotFoundException::class, $event->getError());
+ $event->getOutput()->write('silenced command not found');
+ });
+
+ $application = new Application();
+ $application->setDispatcher($dispatcher);
+ $application->setAutoExit(false);
+
+ $tester = new ApplicationTester($application);
+ $tester->run(array('command' => 'unknown'));
+ $this->assertContains('silenced command not found', $tester->getDisplay());
+ $this->assertEquals(1, $tester->getStatusCode());
+ }
+
+ /**
+ * @group legacy
+ * @expectedDeprecation The "ConsoleEvents::EXCEPTION" event is deprecated since Symfony 3.3 and will be removed in 4.0. Listen to the "ConsoleEvents::ERROR" event instead.
+ */
+ public function testLegacyExceptionListenersAreStillTriggered()
+ {
+ $dispatcher = $this->getDispatcher();
+ $dispatcher->addListener('console.exception', function (ConsoleExceptionEvent $event) {
+ $event->getOutput()->write('caught.');
+
+ $event->setException(new \RuntimeException('replaced in caught.'));
+ });
+
+ $application = new Application();
+ $application->setDispatcher($dispatcher);
+ $application->setAutoExit(false);
+
+ $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
+ throw new \RuntimeException('foo');
+ });
+
+ $tester = new ApplicationTester($application);
+ $tester->run(array('command' => 'foo'));
+ $this->assertContains('before.caught.error.after.', $tester->getDisplay());
+ $this->assertContains('replaced in caught.', $tester->getDisplay());
+ }
+
+ /**
+ * @requires PHP 7
+ */
+ public function testErrorIsRethrownIfNotHandledByConsoleErrorEvent()
+ {
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+ $application->setDispatcher(new EventDispatcher());
+
+ $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) {
+ new \UnknownClass();
+ });
+
+ $tester = new ApplicationTester($application);
+
+ try {
+ $tester->run(array('command' => 'dym'));
+ $this->fail('->run() should rethrow PHP errors if not handled via ConsoleErrorEvent.');
+ } catch (\Error $e) {
+ $this->assertSame($e->getMessage(), 'Class \'UnknownClass\' not found');
+ }
+ }
+
+ /**
+ * @requires PHP 7
+ * @expectedException \LogicException
+ * @expectedExceptionMessage error
+ */
+ public function testRunWithErrorAndDispatcher()
+ {
+ $application = new Application();
+ $application->setDispatcher($this->getDispatcher());
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+
+ $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) {
+ $output->write('dym.');
+
+ throw new \Error('dymerr');
+ });
+
+ $tester = new ApplicationTester($application);
+ $tester->run(array('command' => 'dym'));
+ $this->assertContains('before.dym.error.after.', $tester->getDisplay(), 'The PHP Error did not dispached events');
+ }
+
+ /**
+ * @requires PHP 7
+ */
+ public function testRunDispatchesAllEventsWithError()
+ {
+ $application = new Application();
+ $application->setDispatcher($this->getDispatcher());
+ $application->setAutoExit(false);
+
+ $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) {
+ $output->write('dym.');
+
+ throw new \Error('dymerr');
+ });
+
+ $tester = new ApplicationTester($application);
+ $tester->run(array('command' => 'dym'));
+ $this->assertContains('before.dym.error.after.', $tester->getDisplay(), 'The PHP Error did not dispached events');
+ }
+
+ /**
+ * @requires PHP 7
+ */
+ public function testRunWithErrorFailingStatusCode()
+ {
+ $application = new Application();
+ $application->setDispatcher($this->getDispatcher());
+ $application->setAutoExit(false);
+
+ $application->register('dus')->setCode(function (InputInterface $input, OutputInterface $output) {
+ $output->write('dus.');
+
+ throw new \Error('duserr');
+ });
+
+ $tester = new ApplicationTester($application);
+ $tester->run(array('command' => 'dus'));
+ $this->assertSame(1, $tester->getStatusCode(), 'Status code should be 1');
}
public function testRunWithDispatcherSkippingCommand()
@@ -1026,6 +1412,9 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('some test value', $extraValue);
}
+ /**
+ * @group legacy
+ */
public function testTerminalDimensions()
{
$application = new Application();
@@ -1041,35 +1430,31 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertSame(array($width, 80), $application->getTerminalDimensions());
}
- protected function getDispatcher($skipCommand = false)
+ public function testSetRunCustomDefaultCommand()
{
- $dispatcher = new EventDispatcher();
- $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use ($skipCommand) {
- $event->getOutput()->write('before.');
+ $command = new \FooCommand();
- if ($skipCommand) {
- $event->disableCommand();
- }
- });
- $dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($skipCommand) {
- $event->getOutput()->writeln('after.');
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->add($command);
+ $application->setDefaultCommand($command->getName());
- if (!$skipCommand) {
- $event->setExitCode(113);
- }
- });
- $dispatcher->addListener('console.exception', function (ConsoleExceptionEvent $event) {
- $event->getOutput()->write('caught.');
+ $tester = new ApplicationTester($application);
+ $tester->run(array(), array('interactive' => false));
+ $this->assertEquals('called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command');
- $event->setException(new \LogicException('caught.', $event->getExitCode(), $event->getException()));
- });
+ $application = new CustomDefaultCommandApplication();
+ $application->setAutoExit(false);
- return $dispatcher;
+ $tester = new ApplicationTester($application);
+ $tester->run(array(), array('interactive' => false));
+
+ $this->assertEquals('called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command');
}
- public function testSetRunCustomDefaultCommand()
+ public function testSetRunCustomDefaultCommandWithOption()
{
- $command = new \FooCommand();
+ $command = new \FooOptCommand();
$application = new Application();
$application->setAutoExit(false);
@@ -1077,16 +1462,27 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$application->setDefaultCommand($command->getName());
$tester = new ApplicationTester($application);
- $tester->run(array());
- $this->assertEquals('interact called'.PHP_EOL.'called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command');
+ $tester->run(array('--fooopt' => 'opt'), array('interactive' => false));
- $application = new CustomDefaultCommandApplication();
+ $this->assertEquals('called'.PHP_EOL.'opt'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command');
+ }
+
+ public function testSetRunCustomSingleCommand()
+ {
+ $command = new \FooCommand();
+
+ $application = new Application();
$application->setAutoExit(false);
+ $application->add($command);
+ $application->setDefaultCommand($command->getName(), true);
$tester = new ApplicationTester($application);
+
$tester->run(array());
+ $this->assertContains('called', $tester->getDisplay());
- $this->assertEquals('interact called'.PHP_EOL.'called'.PHP_EOL, $tester->getDisplay(), 'Application runs the default set command if different from \'list\' command');
+ $tester->run(array('--help' => true));
+ $this->assertContains('The foo:bar command', $tester->getDisplay());
}
/**
@@ -1102,9 +1498,119 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($tester->getInput()->hasParameterOption(array('--no-interaction', '-n')));
- $inputStream = $application->getHelperSet()->get('question')->getInputStream();
+ $inputStream = $tester->getInput()->getStream();
$this->assertEquals($tester->getInput()->isInteractive(), @posix_isatty($inputStream));
}
+
+ public function testRunLazyCommandService()
+ {
+ $container = new ContainerBuilder();
+ $container->addCompilerPass(new AddConsoleCommandPass());
+ $container
+ ->register('lazy-command', LazyCommand::class)
+ ->addTag('console.command', array('command' => 'lazy:command'))
+ ->addTag('console.command', array('command' => 'lazy:alias'))
+ ->addTag('console.command', array('command' => 'lazy:alias2'));
+ $container->compile();
+
+ $application = new Application();
+ $application->setCommandLoader($container->get('console.command_loader'));
+ $application->setAutoExit(false);
+
+ $tester = new ApplicationTester($application);
+
+ $tester->run(array('command' => 'lazy:command'));
+ $this->assertSame("lazy-command called\n", $tester->getDisplay(true));
+
+ $tester->run(array('command' => 'lazy:alias'));
+ $this->assertSame("lazy-command called\n", $tester->getDisplay(true));
+
+ $tester->run(array('command' => 'lazy:alias2'));
+ $this->assertSame("lazy-command called\n", $tester->getDisplay(true));
+
+ $command = $application->get('lazy:command');
+ $this->assertSame(array('lazy:alias', 'lazy:alias2'), $command->getAliases());
+ }
+
+ /**
+ * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
+ */
+ public function testGetDisabledLazyCommand()
+ {
+ $application = new Application();
+ $application->setCommandLoader(new FactoryCommandLoader(array('disabled' => function () { return new DisabledCommand(); })));
+ $application->get('disabled');
+ }
+
+ public function testHasReturnsFalseForDisabledLazyCommand()
+ {
+ $application = new Application();
+ $application->setCommandLoader(new FactoryCommandLoader(array('disabled' => function () { return new DisabledCommand(); })));
+ $this->assertFalse($application->has('disabled'));
+ }
+
+ public function testAllExcludesDisabledLazyCommand()
+ {
+ $application = new Application();
+ $application->setCommandLoader(new FactoryCommandLoader(array('disabled' => function () { return new DisabledCommand(); })));
+ $this->assertArrayNotHasKey('disabled', $application->all());
+ }
+
+ protected function getDispatcher($skipCommand = false)
+ {
+ $dispatcher = new EventDispatcher();
+ $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use ($skipCommand) {
+ $event->getOutput()->write('before.');
+
+ if ($skipCommand) {
+ $event->disableCommand();
+ }
+ });
+ $dispatcher->addListener('console.terminate', function (ConsoleTerminateEvent $event) use ($skipCommand) {
+ $event->getOutput()->writeln('after.');
+
+ if (!$skipCommand) {
+ $event->setExitCode(ConsoleCommandEvent::RETURN_CODE_DISABLED);
+ }
+ });
+ $dispatcher->addListener('console.error', function (ConsoleErrorEvent $event) {
+ $event->getOutput()->write('error.');
+
+ $event->setError(new \LogicException('error.', $event->getExitCode(), $event->getError()));
+ });
+
+ return $dispatcher;
+ }
+
+ /**
+ * @requires PHP 7
+ */
+ public function testErrorIsRethrownIfNotHandledByConsoleErrorEventWithCatchingEnabled()
+ {
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setDispatcher(new EventDispatcher());
+
+ $application->register('dym')->setCode(function (InputInterface $input, OutputInterface $output) {
+ new \UnknownClass();
+ });
+
+ $tester = new ApplicationTester($application);
+
+ try {
+ $tester->run(array('command' => 'dym'));
+ $this->fail('->run() should rethrow PHP errors if not handled via ConsoleErrorEvent.');
+ } catch (\Error $e) {
+ $this->assertSame($e->getMessage(), 'Class \'UnknownClass\' not found');
+ }
+ }
+
+ protected function tearDown()
+ {
+ putenv('SHELL_VERBOSITY');
+ unset($_ENV['SHELL_VERBOSITY']);
+ unset($_SERVER['SHELL_VERBOSITY']);
+ }
}
class CustomApplication extends Application
@@ -1144,3 +1650,19 @@ class CustomDefaultCommandApplication extends Application
$this->setDefaultCommand($command->getName());
}
}
+
+class LazyCommand extends Command
+{
+ public function execute(InputInterface $input, OutputInterface $output)
+ {
+ $output->writeln('lazy-command called');
+ }
+}
+
+class DisabledCommand extends Command
+{
+ public function isEnabled()
+ {
+ return false;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Command/CommandTest.php b/vendor/symfony/console/Tests/Command/CommandTest.php
index e8836d8c..4fcbf957 100644
--- a/vendor/symfony/console/Tests/Command/CommandTest.php
+++ b/vendor/symfony/console/Tests/Command/CommandTest.php
@@ -11,6 +11,7 @@
namespace Symfony\Component\Console\Tests\Command;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\FormatterHelper;
use Symfony\Component\Console\Application;
@@ -23,7 +24,7 @@ use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\Console\Tester\CommandTester;
-class CommandTest extends \PHPUnit_Framework_TestCase
+class CommandTest extends TestCase
{
protected static $fixturesPath;
@@ -45,7 +46,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase
*/
public function testCommandNameCannotBeEmpty()
{
- new Command();
+ (new Application())->add(new Command());
}
public function testSetApplication()
@@ -54,6 +55,14 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$command = new \TestCommand();
$command->setApplication($application);
$this->assertEquals($application, $command->getApplication(), '->setApplication() sets the current application');
+ $this->assertEquals($application->getHelperSet(), $command->getHelperSet());
+ }
+
+ public function testSetApplicationNull()
+ {
+ $command = new \TestCommand();
+ $command->setApplication(null);
+ $this->assertNull($command->getHelperSet());
}
public function testSetGetDefinition()
@@ -84,6 +93,13 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($command->getDefinition()->hasOption('foo'), '->addOption() adds an option to the command');
}
+ public function testSetHidden()
+ {
+ $command = new \TestCommand();
+ $command->setHidden(true);
+ $this->assertTrue($command->isHidden());
+ }
+
public function testGetNamespaceGetNameSetName()
{
$command = new \TestCommand();
@@ -101,7 +117,12 @@ class CommandTest extends \PHPUnit_Framework_TestCase
*/
public function testInvalidCommandNames($name)
{
- $this->setExpectedException('InvalidArgumentException', sprintf('Command name "%s" is invalid.', $name));
+ if (method_exists($this, 'expectException')) {
+ $this->expectException('InvalidArgumentException');
+ $this->expectExceptionMessage(sprintf('Command name "%s" is invalid.', $name));
+ } else {
+ $this->setExpectedException('InvalidArgumentException', sprintf('Command name "%s" is invalid.', $name));
+ }
$command = new \TestCommand();
$command->setName($name);
@@ -156,6 +177,13 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(array('name1'), $command->getAliases(), '->setAliases() sets the aliases');
}
+ public function testSetAliasesNull()
+ {
+ $command = new \TestCommand();
+ $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException');
+ $command->setAliases(null);
+ }
+
public function testGetSynopsis()
{
$command = new \TestCommand();
@@ -164,6 +192,15 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('namespace:name [--foo] [--] [<bar>]', $command->getSynopsis(), '->getSynopsis() returns the synopsis');
}
+ public function testAddGetUsages()
+ {
+ $command = new \TestCommand();
+ $command->addUsage('foo1');
+ $command->addUsage('foo2');
+ $this->assertContains('namespace:name foo1', $command->getUsages());
+ $this->assertContains('namespace:name foo2', $command->getUsages());
+ }
+
public function testGetHelper()
{
$application = new Application();
@@ -257,7 +294,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase
}
/**
- * @expectedException Symfony\Component\Console\Exception\InvalidOptionException
+ * @expectedException \Symfony\Component\Console\Exception\InvalidOptionException
* @expectedExceptionMessage The "--bar" option does not exist.
*/
public function testRunWithInvalidOption()
@@ -273,10 +310,10 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$exitCode = $command->run(new StringInput(''), new NullOutput());
$this->assertSame(0, $exitCode, '->run() returns integer exit code (treats null as 0)');
- $command = $this->getMock('TestCommand', array('execute'));
+ $command = $this->getMockBuilder('TestCommand')->setMethods(array('execute'))->getMock();
$command->expects($this->once())
- ->method('execute')
- ->will($this->returnValue('2.3'));
+ ->method('execute')
+ ->will($this->returnValue('2.3'));
$exitCode = $command->run(new StringInput(''), new NullOutput());
$this->assertSame(2, $exitCode, '->run() returns integer exit code (casts numeric to int)');
}
@@ -297,6 +334,20 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$this->assertSame(0, $command->run(new StringInput(''), new NullOutput()));
}
+ public function testRunWithProcessTitle()
+ {
+ $command = new \TestCommand();
+ $command->setApplication(new Application());
+ $command->setProcessTitle('foo');
+ $this->assertSame(0, $command->run(new StringInput(''), new NullOutput()));
+ if (function_exists('cli_set_process_title')) {
+ if (null === @cli_get_process_title() && 'Darwin' === PHP_OS) {
+ $this->markTestSkipped('Running "cli_get_process_title" as an unprivileged user is not supported on MacOS.');
+ }
+ $this->assertEquals('foo', cli_get_process_title());
+ }
+ }
+
public function testSetCode()
{
$command = new \TestCommand();
@@ -319,7 +370,6 @@ class CommandTest extends \PHPUnit_Framework_TestCase
/**
* @dataProvider getSetCodeBindToClosureTests
- * @requires PHP 5.4
*/
public function testSetCodeBindToClosure($previouslyBound, $expected)
{
@@ -335,53 +385,42 @@ class CommandTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('interact called'.PHP_EOL.$expected.PHP_EOL, $tester->getDisplay());
}
- public function testSetCodeWithNonClosureCallable()
+ public function testSetCodeWithStaticClosure()
{
$command = new \TestCommand();
- $ret = $command->setCode(array($this, 'callableMethodCommand'));
- $this->assertEquals($command, $ret, '->setCode() implements a fluent interface');
+ $command->setCode(self::createClosure());
$tester = new CommandTester($command);
$tester->execute(array());
- $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay());
- }
- /**
- * @expectedException \InvalidArgumentException
- * @expectedExceptionMessage Invalid callable provided to Command::setCode.
- */
- public function testSetCodeWithNonCallable()
- {
- $command = new \TestCommand();
- $command->setCode(array($this, 'nonExistentMethod'));
+ if (\PHP_VERSION_ID < 70000) {
+ // Cannot bind static closures in PHP 5
+ $this->assertEquals('interact called'.PHP_EOL.'not bound'.PHP_EOL, $tester->getDisplay());
+ } else {
+ // Can bind static closures in PHP 7
+ $this->assertEquals('interact called'.PHP_EOL.'bound'.PHP_EOL, $tester->getDisplay());
+ }
}
- public function callableMethodCommand(InputInterface $input, OutputInterface $output)
+ private static function createClosure()
{
- $output->writeln('from the code...');
+ return function (InputInterface $input, OutputInterface $output) {
+ $output->writeln(isset($this) ? 'bound' : 'not bound');
+ };
}
- /**
- * @group legacy
- */
- public function testLegacyAsText()
+ public function testSetCodeWithNonClosureCallable()
{
$command = new \TestCommand();
- $command->setApplication(new Application());
+ $ret = $command->setCode(array($this, 'callableMethodCommand'));
+ $this->assertEquals($command, $ret, '->setCode() implements a fluent interface');
$tester = new CommandTester($command);
- $tester->execute(array('command' => $command->getName()));
- $this->assertStringEqualsFile(self::$fixturesPath.'/command_astext.txt', $command->asText(), '->asText() returns a text representation of the command');
+ $tester->execute(array());
+ $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay());
}
- /**
- * @group legacy
- */
- public function testLegacyAsXml()
+ public function callableMethodCommand(InputInterface $input, OutputInterface $output)
{
- $command = new \TestCommand();
- $command->setApplication(new Application());
- $tester = new CommandTester($command);
- $tester->execute(array('command' => $command->getName()));
- $this->assertXmlStringEqualsXmlFile(self::$fixturesPath.'/command_asxml.txt', $command->asXml(), '->asXml() returns an XML representation of the command');
+ $output->writeln('from the code...');
}
}
diff --git a/vendor/symfony/console/Tests/Command/HelpCommandTest.php b/vendor/symfony/console/Tests/Command/HelpCommandTest.php
index 9e068587..4d618ac1 100644
--- a/vendor/symfony/console/Tests/Command/HelpCommandTest.php
+++ b/vendor/symfony/console/Tests/Command/HelpCommandTest.php
@@ -11,12 +11,13 @@
namespace Symfony\Component\Console\Tests\Command;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\Console\Command\HelpCommand;
use Symfony\Component\Console\Command\ListCommand;
use Symfony\Component\Console\Application;
-class HelpCommandTest extends \PHPUnit_Framework_TestCase
+class HelpCommandTest extends TestCase
{
public function testExecuteForCommandAlias()
{
@@ -64,7 +65,7 @@ class HelpCommandTest extends \PHPUnit_Framework_TestCase
$application = new Application();
$commandTester = new CommandTester($application->get('help'));
$commandTester->execute(array('command_name' => 'list', '--format' => 'xml'));
- $this->assertContains('list [--xml] [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
+ $this->assertContains('list [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
$this->assertContains('<command', $commandTester->getDisplay(), '->execute() returns an XML help text if --format=xml is passed');
}
}
diff --git a/vendor/symfony/console/Tests/Command/ListCommandTest.php b/vendor/symfony/console/Tests/Command/ListCommandTest.php
index a166a040..64478ecc 100644
--- a/vendor/symfony/console/Tests/Command/ListCommandTest.php
+++ b/vendor/symfony/console/Tests/Command/ListCommandTest.php
@@ -11,10 +11,11 @@
namespace Symfony\Component\Console\Tests\Command;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\Console\Application;
-class ListCommandTest extends \PHPUnit_Framework_TestCase
+class ListCommandTest extends TestCase
{
public function testExecuteListsCommands()
{
@@ -30,7 +31,7 @@ class ListCommandTest extends \PHPUnit_Framework_TestCase
$application = new Application();
$commandTester = new CommandTester($command = $application->get('list'));
$commandTester->execute(array('command' => $command->getName(), '--format' => 'xml'));
- $this->assertRegExp('/<command id="list" name="list">/', $commandTester->getDisplay(), '->execute() returns a list of available commands in XML if --xml is passed');
+ $this->assertRegExp('/<command id="list" name="list" hidden="0">/', $commandTester->getDisplay(), '->execute() returns a list of available commands in XML if --xml is passed');
}
public function testExecuteListsCommandsWithRawOption()
diff --git a/vendor/symfony/console/Tests/Command/LockableTraitTest.php b/vendor/symfony/console/Tests/Command/LockableTraitTest.php
new file mode 100644
index 00000000..a622d1b4
--- /dev/null
+++ b/vendor/symfony/console/Tests/Command/LockableTraitTest.php
@@ -0,0 +1,67 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests\Command;
+
+use PHPUnit\Framework\TestCase;
+use Symfony\Component\Console\Tester\CommandTester;
+use Symfony\Component\Lock\Factory;
+use Symfony\Component\Lock\Store\FlockStore;
+use Symfony\Component\Lock\Store\SemaphoreStore;
+
+class LockableTraitTest extends TestCase
+{
+ protected static $fixturesPath;
+
+ public static function setUpBeforeClass()
+ {
+ self::$fixturesPath = __DIR__.'/../Fixtures/';
+ require_once self::$fixturesPath.'/FooLockCommand.php';
+ require_once self::$fixturesPath.'/FooLock2Command.php';
+ }
+
+ public function testLockIsReleased()
+ {
+ $command = new \FooLockCommand();
+
+ $tester = new CommandTester($command);
+ $this->assertSame(2, $tester->execute(array()));
+ $this->assertSame(2, $tester->execute(array()));
+ }
+
+ public function testLockReturnsFalseIfAlreadyLockedByAnotherCommand()
+ {
+ $command = new \FooLockCommand();
+
+ if (SemaphoreStore::isSupported(false)) {
+ $store = new SemaphoreStore();
+ } else {
+ $store = new FlockStore();
+ }
+
+ $lock = (new Factory($store))->createLock($command->getName());
+ $lock->acquire();
+
+ $tester = new CommandTester($command);
+ $this->assertSame(1, $tester->execute(array()));
+
+ $lock->release();
+ $this->assertSame(2, $tester->execute(array()));
+ }
+
+ public function testMultipleLockCallsThrowLogicException()
+ {
+ $command = new \FooLock2Command();
+
+ $tester = new CommandTester($command);
+ $this->assertSame(1, $tester->execute(array()));
+ }
+}
diff --git a/vendor/symfony/console/Tests/CommandLoader/ContainerCommandLoaderTest.php b/vendor/symfony/console/Tests/CommandLoader/ContainerCommandLoaderTest.php
new file mode 100644
index 00000000..78eefd24
--- /dev/null
+++ b/vendor/symfony/console/Tests/CommandLoader/ContainerCommandLoaderTest.php
@@ -0,0 +1,61 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests\CommandLoader;
+
+use PHPUnit\Framework\TestCase;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
+use Symfony\Component\DependencyInjection\ServiceLocator;
+
+class ContainerCommandLoaderTest extends TestCase
+{
+ public function testHas()
+ {
+ $loader = new ContainerCommandLoader(new ServiceLocator(array(
+ 'foo-service' => function () { return new Command('foo'); },
+ 'bar-service' => function () { return new Command('bar'); },
+ )), array('foo' => 'foo-service', 'bar' => 'bar-service'));
+
+ $this->assertTrue($loader->has('foo'));
+ $this->assertTrue($loader->has('bar'));
+ $this->assertFalse($loader->has('baz'));
+ }
+
+ public function testGet()
+ {
+ $loader = new ContainerCommandLoader(new ServiceLocator(array(
+ 'foo-service' => function () { return new Command('foo'); },
+ 'bar-service' => function () { return new Command('bar'); },
+ )), array('foo' => 'foo-service', 'bar' => 'bar-service'));
+
+ $this->assertInstanceOf(Command::class, $loader->get('foo'));
+ $this->assertInstanceOf(Command::class, $loader->get('bar'));
+ }
+
+ /**
+ * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
+ */
+ public function testGetUnknownCommandThrows()
+ {
+ (new ContainerCommandLoader(new ServiceLocator(array()), array()))->get('unknown');
+ }
+
+ public function testGetCommandNames()
+ {
+ $loader = new ContainerCommandLoader(new ServiceLocator(array(
+ 'foo-service' => function () { return new Command('foo'); },
+ 'bar-service' => function () { return new Command('bar'); },
+ )), array('foo' => 'foo-service', 'bar' => 'bar-service'));
+
+ $this->assertSame(array('foo', 'bar'), $loader->getNames());
+ }
+}
diff --git a/vendor/symfony/console/Tests/CommandLoader/FactoryCommandLoaderTest.php b/vendor/symfony/console/Tests/CommandLoader/FactoryCommandLoaderTest.php
new file mode 100644
index 00000000..5ee6cd1e
--- /dev/null
+++ b/vendor/symfony/console/Tests/CommandLoader/FactoryCommandLoaderTest.php
@@ -0,0 +1,60 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests\CommandLoader;
+
+use PHPUnit\Framework\TestCase;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\CommandLoader\FactoryCommandLoader;
+
+class FactoryCommandLoaderTest extends TestCase
+{
+ public function testHas()
+ {
+ $loader = new FactoryCommandLoader(array(
+ 'foo' => function () { return new Command('foo'); },
+ 'bar' => function () { return new Command('bar'); },
+ ));
+
+ $this->assertTrue($loader->has('foo'));
+ $this->assertTrue($loader->has('bar'));
+ $this->assertFalse($loader->has('baz'));
+ }
+
+ public function testGet()
+ {
+ $loader = new FactoryCommandLoader(array(
+ 'foo' => function () { return new Command('foo'); },
+ 'bar' => function () { return new Command('bar'); },
+ ));
+
+ $this->assertInstanceOf(Command::class, $loader->get('foo'));
+ $this->assertInstanceOf(Command::class, $loader->get('bar'));
+ }
+
+ /**
+ * @expectedException \Symfony\Component\Console\Exception\CommandNotFoundException
+ */
+ public function testGetUnknownCommandThrows()
+ {
+ (new FactoryCommandLoader(array()))->get('unknown');
+ }
+
+ public function testGetCommandNames()
+ {
+ $loader = new FactoryCommandLoader(array(
+ 'foo' => function () { return new Command('foo'); },
+ 'bar' => function () { return new Command('bar'); },
+ ));
+
+ $this->assertSame(array('foo', 'bar'), $loader->getNames());
+ }
+}
diff --git a/vendor/symfony/console/Tests/DependencyInjection/AddConsoleCommandPassTest.php b/vendor/symfony/console/Tests/DependencyInjection/AddConsoleCommandPassTest.php
new file mode 100644
index 00000000..34f64861
--- /dev/null
+++ b/vendor/symfony/console/Tests/DependencyInjection/AddConsoleCommandPassTest.php
@@ -0,0 +1,187 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests\DependencyInjection;
+
+use PHPUnit\Framework\TestCase;
+use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
+use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Definition;
+use Symfony\Component\DependencyInjection\TypedReference;
+
+class AddConsoleCommandPassTest extends TestCase
+{
+ /**
+ * @dataProvider visibilityProvider
+ */
+ public function testProcess($public)
+ {
+ $container = new ContainerBuilder();
+ $container->addCompilerPass(new AddConsoleCommandPass());
+ $container->setParameter('my-command.class', 'Symfony\Component\Console\Tests\DependencyInjection\MyCommand');
+
+ $definition = new Definition('%my-command.class%');
+ $definition->setPublic($public);
+ $definition->addTag('console.command');
+ $container->setDefinition('my-command', $definition);
+
+ $container->compile();
+
+ $alias = 'console.command.symfony_component_console_tests_dependencyinjection_mycommand';
+
+ if ($public) {
+ $this->assertFalse($container->hasAlias($alias));
+ $id = 'my-command';
+ } else {
+ $id = $alias;
+ // The alias is replaced by a Definition by the ReplaceAliasByActualDefinitionPass
+ // in case the original service is private
+ $this->assertFalse($container->hasDefinition('my-command'));
+ $this->assertTrue($container->hasDefinition($alias));
+ }
+
+ $this->assertTrue($container->hasParameter('console.command.ids'));
+ $this->assertSame(array($alias => $id), $container->getParameter('console.command.ids'));
+ }
+
+ public function testProcessRegistersLazyCommands()
+ {
+ $container = new ContainerBuilder();
+ $command = $container
+ ->register('my-command', MyCommand::class)
+ ->setPublic(false)
+ ->addTag('console.command', array('command' => 'my:command'))
+ ->addTag('console.command', array('command' => 'my:alias'))
+ ;
+
+ (new AddConsoleCommandPass())->process($container);
+
+ $commandLoader = $container->getDefinition('console.command_loader');
+ $commandLocator = $container->getDefinition((string) $commandLoader->getArgument(0));
+
+ $this->assertSame(ContainerCommandLoader::class, $commandLoader->getClass());
+ $this->assertSame(array('my:command' => 'my-command', 'my:alias' => 'my-command'), $commandLoader->getArgument(1));
+ $this->assertEquals(array(array('my-command' => new ServiceClosureArgument(new TypedReference('my-command', MyCommand::class)))), $commandLocator->getArguments());
+ $this->assertSame(array('console.command.symfony_component_console_tests_dependencyinjection_mycommand' => 'my-command'), $container->getParameter('console.command.ids'));
+ $this->assertSame(array('my-command' => true), $container->getParameter('console.lazy_command.ids'));
+ $this->assertSame(array(array('setName', array('my:command')), array('setAliases', array(array('my:alias')))), $command->getMethodCalls());
+ }
+
+ public function testProcessFallsBackToDefaultName()
+ {
+ $container = new ContainerBuilder();
+ $container
+ ->register('with-default-name', NamedCommand::class)
+ ->setPublic(false)
+ ->addTag('console.command')
+ ;
+
+ $pass = new AddConsoleCommandPass();
+ $pass->process($container);
+
+ $commandLoader = $container->getDefinition('console.command_loader');
+ $commandLocator = $container->getDefinition((string) $commandLoader->getArgument(0));
+
+ $this->assertSame(ContainerCommandLoader::class, $commandLoader->getClass());
+ $this->assertSame(array('default' => 'with-default-name'), $commandLoader->getArgument(1));
+ $this->assertEquals(array(array('with-default-name' => new ServiceClosureArgument(new TypedReference('with-default-name', NamedCommand::class)))), $commandLocator->getArguments());
+ $this->assertSame(array('console.command.symfony_component_console_tests_dependencyinjection_namedcommand' => 'with-default-name'), $container->getParameter('console.command.ids'));
+ $this->assertSame(array('with-default-name' => true), $container->getParameter('console.lazy_command.ids'));
+
+ $container = new ContainerBuilder();
+ $container
+ ->register('with-default-name', NamedCommand::class)
+ ->setPublic(false)
+ ->addTag('console.command', array('command' => 'new-name'))
+ ;
+
+ $pass->process($container);
+
+ $this->assertSame(array('new-name' => 'with-default-name'), $container->getDefinition('console.command_loader')->getArgument(1));
+ }
+
+ public function visibilityProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ );
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The service "my-command" tagged "console.command" must not be abstract.
+ */
+ public function testProcessThrowAnExceptionIfTheServiceIsAbstract()
+ {
+ $container = new ContainerBuilder();
+ $container->setResourceTracking(false);
+ $container->addCompilerPass(new AddConsoleCommandPass());
+
+ $definition = new Definition('Symfony\Component\Console\Tests\DependencyInjection\MyCommand');
+ $definition->addTag('console.command');
+ $definition->setAbstract(true);
+ $container->setDefinition('my-command', $definition);
+
+ $container->compile();
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The service "my-command" tagged "console.command" must be a subclass of "Symfony\Component\Console\Command\Command".
+ */
+ public function testProcessThrowAnExceptionIfTheServiceIsNotASubclassOfCommand()
+ {
+ $container = new ContainerBuilder();
+ $container->setResourceTracking(false);
+ $container->addCompilerPass(new AddConsoleCommandPass());
+
+ $definition = new Definition('SplObjectStorage');
+ $definition->addTag('console.command');
+ $container->setDefinition('my-command', $definition);
+
+ $container->compile();
+ }
+
+ public function testProcessPrivateServicesWithSameCommand()
+ {
+ $container = new ContainerBuilder();
+ $className = 'Symfony\Component\Console\Tests\DependencyInjection\MyCommand';
+
+ $definition1 = new Definition($className);
+ $definition1->addTag('console.command')->setPublic(false);
+
+ $definition2 = new Definition($className);
+ $definition2->addTag('console.command')->setPublic(false);
+
+ $container->setDefinition('my-command1', $definition1);
+ $container->setDefinition('my-command2', $definition2);
+
+ (new AddConsoleCommandPass())->process($container);
+
+ $alias1 = 'console.command.symfony_component_console_tests_dependencyinjection_mycommand';
+ $alias2 = $alias1.'_my-command2';
+ $this->assertTrue($container->hasAlias($alias1));
+ $this->assertTrue($container->hasAlias($alias2));
+ }
+}
+
+class MyCommand extends Command
+{
+}
+
+class NamedCommand extends Command
+{
+ protected static $defaultName = 'default';
+}
diff --git a/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php
index c36c4a8e..3686e754 100644
--- a/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php
+++ b/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php
@@ -11,6 +11,7 @@
namespace Symfony\Component\Console\Tests\Descriptor;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
@@ -18,7 +19,7 @@ use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\BufferedOutput;
-abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase
+abstract class AbstractDescriptorTest extends TestCase
{
/** @dataProvider getDescribeInputArgumentTestData */
public function testDescribeInputArgument(InputArgument $argument, $expectedDescription)
@@ -86,7 +87,7 @@ abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase
abstract protected function getFormat();
- private function getDescriptionTestData(array $objects)
+ protected function getDescriptionTestData(array $objects)
{
$data = array();
foreach ($objects as $name => $object) {
@@ -97,10 +98,10 @@ abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase
return $data;
}
- protected function assertDescription($expectedDescription, $describedObject)
+ protected function assertDescription($expectedDescription, $describedObject, array $options = array())
{
$output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
- $this->getDescriptor()->describe($output, $describedObject, array('raw_output' => true));
+ $this->getDescriptor()->describe($output, $describedObject, $options + array('raw_output' => true));
$this->assertEquals(trim($expectedDescription), trim(str_replace(PHP_EOL, "\n", $output->fetch())));
}
}
diff --git a/vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php
index f9a15612..dffcaf66 100644
--- a/vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php
+++ b/vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php
@@ -26,10 +26,10 @@ class JsonDescriptorTest extends AbstractDescriptorTest
return 'json';
}
- protected function assertDescription($expectedDescription, $describedObject)
+ protected function assertDescription($expectedDescription, $describedObject, array $options = array())
{
$output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
- $this->getDescriptor()->describe($output, $describedObject, array('raw_output' => true));
+ $this->getDescriptor()->describe($output, $describedObject, $options + array('raw_output' => true));
$this->assertEquals(json_decode(trim($expectedDescription), true), json_decode(trim(str_replace(PHP_EOL, "\n", $output->fetch())), true));
}
}
diff --git a/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php
index c85e8a59..eb80f58b 100644
--- a/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php
+++ b/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php
@@ -12,9 +12,27 @@
namespace Symfony\Component\Console\Tests\Descriptor;
use Symfony\Component\Console\Descriptor\MarkdownDescriptor;
+use Symfony\Component\Console\Tests\Fixtures\DescriptorApplicationMbString;
+use Symfony\Component\Console\Tests\Fixtures\DescriptorCommandMbString;
class MarkdownDescriptorTest extends AbstractDescriptorTest
{
+ public function getDescribeCommandTestData()
+ {
+ return $this->getDescriptionTestData(array_merge(
+ ObjectsProvider::getCommands(),
+ array('command_mbstring' => new DescriptorCommandMbString())
+ ));
+ }
+
+ public function getDescribeApplicationTestData()
+ {
+ return $this->getDescriptionTestData(array_merge(
+ ObjectsProvider::getApplications(),
+ array('application_mbstring' => new DescriptorApplicationMbString())
+ ));
+ }
+
protected function getDescriptor()
{
return new MarkdownDescriptor();
diff --git a/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php b/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php
index 45b3b2ff..b4f34ada 100644
--- a/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php
+++ b/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php
@@ -31,6 +31,8 @@ class ObjectsProvider
'input_argument_2' => new InputArgument('argument_name', InputArgument::IS_ARRAY, 'argument description'),
'input_argument_3' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', 'default_value'),
'input_argument_4' => new InputArgument('argument_name', InputArgument::REQUIRED, "multiline\nargument description"),
+ 'input_argument_with_style' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', '<comment>style</>'),
+ 'input_argument_with_default_inf_value' => new InputArgument('argument_name', InputArgument::OPTIONAL, 'argument description', INF),
);
}
@@ -43,6 +45,9 @@ class ObjectsProvider
'input_option_4' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'option description', array()),
'input_option_5' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, "multiline\noption description"),
'input_option_6' => new InputOption('option_name', array('o', 'O'), InputOption::VALUE_REQUIRED, 'option with multiple shortcuts'),
+ 'input_option_with_style' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description', '<comment>style</>'),
+ 'input_option_with_style_array' => new InputOption('option_name', 'o', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'option description', array('<comment>Hello</comment>', '<info>world</info>')),
+ 'input_option_with_default_inf_value' => new InputOption('option_name', 'o', InputOption::VALUE_OPTIONAL, 'option description', INF),
);
}
diff --git a/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php
index 350b6795..c024a522 100644
--- a/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php
+++ b/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php
@@ -12,9 +12,35 @@
namespace Symfony\Component\Console\Tests\Descriptor;
use Symfony\Component\Console\Descriptor\TextDescriptor;
+use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication2;
+use Symfony\Component\Console\Tests\Fixtures\DescriptorApplicationMbString;
+use Symfony\Component\Console\Tests\Fixtures\DescriptorCommandMbString;
class TextDescriptorTest extends AbstractDescriptorTest
{
+ public function getDescribeCommandTestData()
+ {
+ return $this->getDescriptionTestData(array_merge(
+ ObjectsProvider::getCommands(),
+ array('command_mbstring' => new DescriptorCommandMbString())
+ ));
+ }
+
+ public function getDescribeApplicationTestData()
+ {
+ return $this->getDescriptionTestData(array_merge(
+ ObjectsProvider::getApplications(),
+ array('application_mbstring' => new DescriptorApplicationMbString())
+ ));
+ }
+
+ public function testDescribeApplicationWithFilteredNamespace()
+ {
+ $application = new DescriptorApplication2();
+
+ $this->assertDescription(file_get_contents(__DIR__.'/../Fixtures/application_filtered_namespace.txt'), $application, array('namespace' => 'command4'));
+ }
+
protected function getDescriptor()
{
return new TextDescriptor();
diff --git a/vendor/symfony/console/Tests/EventListener/ErrorListenerTest.php b/vendor/symfony/console/Tests/EventListener/ErrorListenerTest.php
new file mode 100644
index 00000000..17eaae09
--- /dev/null
+++ b/vendor/symfony/console/Tests/EventListener/ErrorListenerTest.php
@@ -0,0 +1,156 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests\EventListener;
+
+use PHPUnit\Framework\TestCase;
+use Psr\Log\LoggerInterface;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Event\ConsoleErrorEvent;
+use Symfony\Component\Console\Event\ConsoleTerminateEvent;
+use Symfony\Component\Console\EventListener\ErrorListener;
+use Symfony\Component\Console\Input\ArgvInput;
+use Symfony\Component\Console\Input\ArrayInput;
+use Symfony\Component\Console\Input\Input;
+use Symfony\Component\Console\Input\StringInput;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class ErrorListenerTest extends TestCase
+{
+ public function testOnConsoleError()
+ {
+ $error = new \TypeError('An error occurred');
+
+ $logger = $this->getLogger();
+ $logger
+ ->expects($this->once())
+ ->method('error')
+ ->with('Error thrown while running command "{command}". Message: "{message}"', array('error' => $error, 'command' => 'test:run --foo=baz buzz', 'message' => 'An error occurred'))
+ ;
+
+ $listener = new ErrorListener($logger);
+ $listener->onConsoleError(new ConsoleErrorEvent(new ArgvInput(array('console.php', 'test:run', '--foo=baz', 'buzz')), $this->getOutput(), $error, new Command('test:run')));
+ }
+
+ public function testOnConsoleErrorWithNoCommandAndNoInputString()
+ {
+ $error = new \RuntimeException('An error occurred');
+
+ $logger = $this->getLogger();
+ $logger
+ ->expects($this->once())
+ ->method('error')
+ ->with('An error occurred while using the console. Message: "{message}"', array('error' => $error, 'message' => 'An error occurred'))
+ ;
+
+ $listener = new ErrorListener($logger);
+ $listener->onConsoleError(new ConsoleErrorEvent(new NonStringInput(), $this->getOutput(), $error));
+ }
+
+ public function testOnConsoleTerminateForNonZeroExitCodeWritesToLog()
+ {
+ $logger = $this->getLogger();
+ $logger
+ ->expects($this->once())
+ ->method('debug')
+ ->with('Command "{command}" exited with code "{code}"', array('command' => 'test:run', 'code' => 255))
+ ;
+
+ $listener = new ErrorListener($logger);
+ $listener->onConsoleTerminate($this->getConsoleTerminateEvent(new ArgvInput(array('console.php', 'test:run')), 255));
+ }
+
+ public function testOnConsoleTerminateForZeroExitCodeDoesNotWriteToLog()
+ {
+ $logger = $this->getLogger();
+ $logger
+ ->expects($this->never())
+ ->method('debug')
+ ;
+
+ $listener = new ErrorListener($logger);
+ $listener->onConsoleTerminate($this->getConsoleTerminateEvent(new ArgvInput(array('console.php', 'test:run')), 0));
+ }
+
+ public function testGetSubscribedEvents()
+ {
+ $this->assertEquals(
+ array(
+ 'console.error' => array('onConsoleError', -128),
+ 'console.terminate' => array('onConsoleTerminate', -128),
+ ),
+ ErrorListener::getSubscribedEvents()
+ );
+ }
+
+ public function testAllKindsOfInputCanBeLogged()
+ {
+ $logger = $this->getLogger();
+ $logger
+ ->expects($this->exactly(3))
+ ->method('debug')
+ ->with('Command "{command}" exited with code "{code}"', array('command' => 'test:run --foo=bar', 'code' => 255))
+ ;
+
+ $listener = new ErrorListener($logger);
+ $listener->onConsoleTerminate($this->getConsoleTerminateEvent(new ArgvInput(array('console.php', 'test:run', '--foo=bar')), 255));
+ $listener->onConsoleTerminate($this->getConsoleTerminateEvent(new ArrayInput(array('name' => 'test:run', '--foo' => 'bar')), 255));
+ $listener->onConsoleTerminate($this->getConsoleTerminateEvent(new StringInput('test:run --foo=bar'), 255));
+ }
+
+ public function testCommandNameIsDisplayedForNonStringableInput()
+ {
+ $logger = $this->getLogger();
+ $logger
+ ->expects($this->once())
+ ->method('debug')
+ ->with('Command "{command}" exited with code "{code}"', array('command' => 'test:run', 'code' => 255))
+ ;
+
+ $listener = new ErrorListener($logger);
+ $listener->onConsoleTerminate($this->getConsoleTerminateEvent($this->getMockBuilder(InputInterface::class)->getMock(), 255));
+ }
+
+ private function getLogger()
+ {
+ return $this->getMockForAbstractClass(LoggerInterface::class);
+ }
+
+ private function getConsoleTerminateEvent(InputInterface $input, $exitCode)
+ {
+ return new ConsoleTerminateEvent(new Command('test:run'), $input, $this->getOutput(), $exitCode);
+ }
+
+ private function getOutput()
+ {
+ return $this->getMockBuilder(OutputInterface::class)->getMock();
+ }
+}
+
+class NonStringInput extends Input
+{
+ public function getFirstArgument()
+ {
+ }
+
+ public function hasParameterOption($values, $onlyParams = false)
+ {
+ }
+
+ public function getParameterOption($values, $default = false, $onlyParams = false)
+ {
+ }
+
+ public function parse()
+ {
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.php b/vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.php
index ff551358..7bb02fa5 100644
--- a/vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.php
+++ b/vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.php
@@ -20,5 +20,7 @@ class DescriptorApplication2 extends Application
parent::__construct('My Symfony application', 'v1.0');
$this->add(new DescriptorCommand1());
$this->add(new DescriptorCommand2());
+ $this->add(new DescriptorCommand3());
+ $this->add(new DescriptorCommand4());
}
}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorApplicationMbString.php b/vendor/symfony/console/Tests/Fixtures/DescriptorApplicationMbString.php
new file mode 100644
index 00000000..bf170c44
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/DescriptorApplicationMbString.php
@@ -0,0 +1,24 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests\Fixtures;
+
+use Symfony\Component\Console\Application;
+
+class DescriptorApplicationMbString extends Application
+{
+ public function __construct()
+ {
+ parent::__construct('MbString åpplicätion');
+
+ $this->add(new DescriptorCommandMbString());
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand3.php b/vendor/symfony/console/Tests/Fixtures/DescriptorCommand3.php
new file mode 100644
index 00000000..77f92e23
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/DescriptorCommand3.php
@@ -0,0 +1,27 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests\Fixtures;
+
+use Symfony\Component\Console\Command\Command;
+
+class DescriptorCommand3 extends Command
+{
+ protected function configure()
+ {
+ $this
+ ->setName('descriptor:command3')
+ ->setDescription('command 3 description')
+ ->setHelp('command 3 help')
+ ->setHidden(true)
+ ;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand4.php b/vendor/symfony/console/Tests/Fixtures/DescriptorCommand4.php
new file mode 100644
index 00000000..13e8e5ba
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/DescriptorCommand4.php
@@ -0,0 +1,25 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests\Fixtures;
+
+use Symfony\Component\Console\Command\Command;
+
+class DescriptorCommand4 extends Command
+{
+ protected function configure()
+ {
+ $this
+ ->setName('descriptor:command4')
+ ->setAliases(array('descriptor:alias_command4', 'command4:descriptor'))
+ ;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorCommandMbString.php b/vendor/symfony/console/Tests/Fixtures/DescriptorCommandMbString.php
new file mode 100644
index 00000000..66de917e
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/DescriptorCommandMbString.php
@@ -0,0 +1,32 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests\Fixtures;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+
+class DescriptorCommandMbString extends Command
+{
+ protected function configure()
+ {
+ $this
+ ->setName('descriptor:åèä')
+ ->setDescription('command åèä description')
+ ->setHelp('command åèä help')
+ ->addUsage('-o|--option_name <argument_name>')
+ ->addUsage('<argument_name>')
+ ->addArgument('argument_åèä', InputArgument::REQUIRED)
+ ->addOption('option_åèä', 'o', InputOption::VALUE_NONE)
+ ;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/DummyOutput.php b/vendor/symfony/console/Tests/Fixtures/DummyOutput.php
index 0070c0a4..866e2143 100644
--- a/vendor/symfony/console/Tests/Fixtures/DummyOutput.php
+++ b/vendor/symfony/console/Tests/Fixtures/DummyOutput.php
@@ -26,7 +26,7 @@ class DummyOutput extends BufferedOutput
public function getLogs()
{
$logs = array();
- foreach (explode("\n", trim($this->fetch())) as $message) {
+ foreach (explode(PHP_EOL, trim($this->fetch())) as $message) {
preg_match('/^\[(.*)\] (.*)/', $message, $matches);
$logs[] = sprintf('%s %s', $matches[1], $matches[2]);
}
diff --git a/vendor/symfony/console/Tests/Fixtures/Foo3Command.php b/vendor/symfony/console/Tests/Fixtures/Foo3Command.php
index 6c890faf..adb3a2d8 100644
--- a/vendor/symfony/console/Tests/Fixtures/Foo3Command.php
+++ b/vendor/symfony/console/Tests/Fixtures/Foo3Command.php
@@ -23,7 +23,7 @@ class Foo3Command extends Command
throw new \Exception('Second exception <comment>comment</comment>', 0, $e);
}
} catch (\Exception $e) {
- throw new \Exception('Third exception <fg=blue;bg=red>comment</>', 0, $e);
+ throw new \Exception('Third exception <fg=blue;bg=red>comment</>', 404, $e);
}
}
}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooLock2Command.php b/vendor/symfony/console/Tests/Fixtures/FooLock2Command.php
new file mode 100644
index 00000000..4e4656f2
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/FooLock2Command.php
@@ -0,0 +1,28 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Command\LockableTrait;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class FooLock2Command extends Command
+{
+ use LockableTrait;
+
+ protected function configure()
+ {
+ $this->setName('foo:lock2');
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ try {
+ $this->lock();
+ $this->lock();
+ } catch (LogicException $e) {
+ return 1;
+ }
+
+ return 2;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooLockCommand.php b/vendor/symfony/console/Tests/Fixtures/FooLockCommand.php
new file mode 100644
index 00000000..dfa28a6b
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/FooLockCommand.php
@@ -0,0 +1,27 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Command\LockableTrait;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class FooLockCommand extends Command
+{
+ use LockableTrait;
+
+ protected function configure()
+ {
+ $this->setName('foo:lock');
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ if (!$this->lock()) {
+ return 1;
+ }
+
+ $this->release();
+
+ return 2;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooOptCommand.php b/vendor/symfony/console/Tests/Fixtures/FooOptCommand.php
new file mode 100644
index 00000000..9043aa48
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/FooOptCommand.php
@@ -0,0 +1,36 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class FooOptCommand extends Command
+{
+ public $input;
+ public $output;
+
+ protected function configure()
+ {
+ $this
+ ->setName('foo:bar')
+ ->setDescription('The foo:bar command')
+ ->setAliases(array('afoobar'))
+ ->addOption('fooopt', 'fo', InputOption::VALUE_OPTIONAL, 'fooopt description')
+ ;
+ }
+
+ protected function interact(InputInterface $input, OutputInterface $output)
+ {
+ $output->writeln('interact called');
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->input = $input;
+ $this->output = $output;
+
+ $output->writeln('called');
+ $output->writeln($this->input->getOption('fooopt'));
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooSameCaseLowercaseCommand.php b/vendor/symfony/console/Tests/Fixtures/FooSameCaseLowercaseCommand.php
new file mode 100644
index 00000000..c875be0c
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/FooSameCaseLowercaseCommand.php
@@ -0,0 +1,11 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+
+class FooSameCaseLowercaseCommand extends Command
+{
+ protected function configure()
+ {
+ $this->setName('foo:bar')->setDescription('foo:bar command');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooSameCaseUppercaseCommand.php b/vendor/symfony/console/Tests/Fixtures/FooSameCaseUppercaseCommand.php
new file mode 100644
index 00000000..75c8d002
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/FooSameCaseUppercaseCommand.php
@@ -0,0 +1,11 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+
+class FooSameCaseUppercaseCommand extends Command
+{
+ protected function configure()
+ {
+ $this->setName('foo:BAR')->setDescription('foo:BAR command');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_0.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_0.php
index 996fafb9..8fe7c077 100644
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_0.php
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_0.php
@@ -2,10 +2,10 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure has single blank line at start when using block element
return function (InputInterface $input, OutputInterface $output) {
- $output = new SymfonyStyleWithForcedLineLength($input, $output);
+ $output = new SymfonyStyle($input, $output);
$output->caution('Lorem ipsum dolor sit amet');
};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_1.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_1.php
index 6634cd56..e5c700d6 100644
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_1.php
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_1.php
@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure has single blank line between titles and blocks
return function (InputInterface $input, OutputInterface $output) {
- $output = new SymfonyStyleWithForcedLineLength($input, $output);
+ $output = new SymfonyStyle($input, $output);
$output->title('Title');
$output->warning('Lorem ipsum dolor sit amet');
$output->title('Title');
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_10.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_10.php
index 4120df9c..3111873d 100644
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_10.php
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_10.php
@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure that all lines are aligned to the begin of the first line in a very long line block
return function (InputInterface $input, OutputInterface $output) {
- $output = new SymfonyStyleWithForcedLineLength($input, $output);
+ $output = new SymfonyStyle($input, $output);
$output->block(
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
'CUSTOM',
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php
index a2781ddb..3ed897de 100644
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php
@@ -2,12 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+use Symfony\Component\Console\Style\SymfonyStyle;
-//Ensure that all lines are aligned to the begin of the first one and start with '//' in a very long line comment
+// ensure long words are properly wrapped in blocks
return function (InputInterface $input, OutputInterface $output) {
- $output = new SymfonyStyleWithForcedLineLength($input, $output);
- $output->comment(
- 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum'
- );
+ $word = 'Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon';
+ $sfStyle = new SymfonyStyle($input, $output);
+ $sfStyle->block($word, 'CUSTOM', 'fg=white;bg=blue', ' § ', false);
};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_12.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_12.php
new file mode 100644
index 00000000..8c458ae7
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_12.php
@@ -0,0 +1,13 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
+// ensure that all lines are aligned to the begin of the first one and start with '//' in a very long line comment
+return function (InputInterface $input, OutputInterface $output) {
+ $output = new SymfonyStyle($input, $output);
+ $output->comment(
+ 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum'
+ );
+};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_13.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_13.php
new file mode 100644
index 00000000..827cbad1
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_13.php
@@ -0,0 +1,14 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
+// ensure that nested tags have no effect on the color of the '//' prefix
+return function (InputInterface $input, OutputInterface $output) {
+ $output->setDecorated(true);
+ $output = new SymfonyStyle($input, $output);
+ $output->comment(
+ 'Lorem ipsum dolor sit <comment>amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</comment> Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum'
+ );
+};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_14.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_14.php
new file mode 100644
index 00000000..a893a48b
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_14.php
@@ -0,0 +1,17 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
+// ensure that block() behaves properly with a prefix and without type
+return function (InputInterface $input, OutputInterface $output) {
+ $output = new SymfonyStyle($input, $output);
+ $output->block(
+ 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
+ null,
+ null,
+ '$ ',
+ true
+ );
+};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_15.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_15.php
new file mode 100644
index 00000000..68402cd4
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_15.php
@@ -0,0 +1,14 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
+// ensure that block() behaves properly with a type and without prefix
+return function (InputInterface $input, OutputInterface $output) {
+ $output = new SymfonyStyle($input, $output);
+ $output->block(
+ 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
+ 'TEST'
+ );
+};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_16.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_16.php
new file mode 100644
index 00000000..66e81796
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_16.php
@@ -0,0 +1,15 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
+// ensure that block() output is properly formatted (even padding lines)
+return function (InputInterface $input, OutputInterface $output) {
+ $output->setDecorated(true);
+ $output = new SymfonyStyle($input, $output);
+ $output->success(
+ 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
+ 'TEST'
+ );
+};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_17.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_17.php
new file mode 100644
index 00000000..311e6b39
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_17.php
@@ -0,0 +1,13 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
+//Ensure symfony style helper methods handle trailing backslashes properly when decorating user texts
+return function (InputInterface $input, OutputInterface $output) {
+ $output = new SymfonyStyle($input, $output);
+
+ $output->title('Title ending with \\');
+ $output->section('Section ending with \\');
+};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php
index 6004e3d6..791b626f 100644
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php
@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure has single blank line between blocks
return function (InputInterface $input, OutputInterface $output) {
- $output = new SymfonyStyleWithForcedLineLength($input, $output);
+ $output = new SymfonyStyle($input, $output);
$output->warning('Warning');
$output->caution('Caution');
$output->error('Error');
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_3.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_3.php
index c7a08f13..99253a6c 100644
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_3.php
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_3.php
@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure has single blank line between two titles
return function (InputInterface $input, OutputInterface $output) {
- $output = new SymfonyStyleWithForcedLineLength($input, $output);
+ $output = new SymfonyStyle($input, $output);
$output->title('First title');
$output->title('Second title');
};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4.php
index afea70c7..0c5d3fb2 100644
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4.php
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4.php
@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure has single blank line after any text and a title
return function (InputInterface $input, OutputInterface $output) {
- $output = new SymfonyStyleWithForcedLineLength($input, $output);
+ $output = new SymfonyStyle($input, $output);
$output->write('Lorem ipsum dolor sit amet');
$output->title('First title');
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php
index d2c68a9e..96433ed5 100644
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php
@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+use Symfony\Component\Console\Style\SymfonyStyle;
-//Ensure has proper line ending before outputing a text block like with SymfonyStyle::listing() or SymfonyStyle::text()
+//Ensure has proper line ending before outputting a text block like with SymfonyStyle::listing() or SymfonyStyle::text()
return function (InputInterface $input, OutputInterface $output) {
- $output = new SymfonyStyleWithForcedLineLength($input, $output);
+ $output = new SymfonyStyle($input, $output);
$output->writeln('Lorem ipsum dolor sit amet');
$output->listing(array(
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_6.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_6.php
index f1d79905..8031ec9c 100644
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_6.php
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_6.php
@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure has proper blank line after text block when using a block like with SymfonyStyle::success
return function (InputInterface $input, OutputInterface $output) {
- $output = new SymfonyStyleWithForcedLineLength($input, $output);
+ $output = new SymfonyStyle($input, $output);
$output->listing(array(
'Lorem ipsum dolor sit amet',
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_7.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_7.php
index cbfea734..203eb5b1 100644
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_7.php
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_7.php
@@ -2,11 +2,11 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure questions do not output anything when input is non-interactive
return function (InputInterface $input, OutputInterface $output) {
- $output = new SymfonyStyleWithForcedLineLength($input, $output);
+ $output = new SymfonyStyle($input, $output);
$output->title('Title');
$output->askHidden('Hidden question');
$output->choice('Choice question with default', array('choice1', 'choice2'), 'choice1');
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_8.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_8.php
index 0244fd27..922ef1f9 100644
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_8.php
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_8.php
@@ -2,7 +2,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Console\Helper\TableCell;
//Ensure formatting tables when using multiple headers with TableCell
@@ -21,6 +21,6 @@ return function (InputInterface $input, OutputInterface $output) {
array('978-0804169127', 'Divine Comedy'),
);
- $output = new SymfonyStyleWithForcedLineLength($input, $output);
+ $output = new SymfonyStyle($input, $output);
$output->table($headers, $rows);
};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_9.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_9.php
index 6420730f..57afdf06 100644
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_9.php
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_9.php
@@ -2,10 +2,10 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+use Symfony\Component\Console\Style\SymfonyStyle;
//Ensure that all lines are aligned to the begin of the first line in a multi-line block
return function (InputInterface $input, OutputInterface $output) {
- $output = new SymfonyStyleWithForcedLineLength($input, $output);
+ $output = new SymfonyStyle($input, $output);
$output->block(array('Custom block', 'Second custom block line'), 'CUSTOM', 'fg=white;bg=green', 'X ', true);
};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/interactive_command_1.php b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/interactive_command_1.php
new file mode 100644
index 00000000..3c9c7440
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/interactive_command_1.php
@@ -0,0 +1,19 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
+//Ensure that questions have the expected outputs
+return function (InputInterface $input, OutputInterface $output) {
+ $output = new SymfonyStyle($input, $output);
+ $stream = fopen('php://memory', 'r+', false);
+
+ fwrite($stream, "Foo\nBar\nBaz");
+ rewind($stream);
+ $input->setStream($stream);
+
+ $output->ask('What\'s your name?');
+ $output->ask('How are you?');
+ $output->ask('Where do you come from?');
+};
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/interactive_output_1.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/interactive_output_1.txt
new file mode 100644
index 00000000..6fc7d7eb
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/interactive_output_1.txt
@@ -0,0 +1,7 @@
+
+ What's your name?:
+ >
+ How are you?:
+ >
+ Where do you come from?:
+ >
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_11.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_11.txt
index 9983af83..190d7840 100644
--- a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_11.txt
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_11.txt
@@ -1,6 +1,4 @@
- // Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
- // aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
- // Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
- // sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
+ § [CUSTOM] Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophatto
+ § peristeralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygon
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_12.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_12.txt
new file mode 100644
index 00000000..9983af83
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_12.txt
@@ -0,0 +1,6 @@
+
+ // Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
+ // aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+ // Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
+ // sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
+
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_13.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_13.txt
new file mode 100644
index 00000000..0f3704b7
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_13.txt
@@ -0,0 +1,7 @@
+
+ // Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et 
+ // dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea 
+ // commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla 
+ // pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim
+ // id est laborum
+
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_14.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_14.txt
new file mode 100644
index 00000000..1d0d37e7
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_14.txt
@@ -0,0 +1,6 @@
+
+$ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
+$ aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+$ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
+$ occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
+
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_15.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_15.txt
new file mode 100644
index 00000000..66404b81
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_15.txt
@@ -0,0 +1,7 @@
+
+ [TEST] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore
+ magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est
+ laborum
+
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_16.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_16.txt
new file mode 100644
index 00000000..a0d18016
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_16.txt
@@ -0,0 +1,8 @@
+
+ 
+ [OK] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore 
+ magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum 
+ 
+
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_17.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_17.txt
new file mode 100644
index 00000000..59d00e04
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_17.txt
@@ -0,0 +1,7 @@
+
+Title ending with \
+===================
+
+Section ending with \
+---------------------
+
diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.json b/vendor/symfony/console/Tests/Fixtures/application_1.json
index b17b38d8..29faa826 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_1.json
+++ b/vendor/symfony/console/Tests/Fixtures/application_1.json
@@ -1 +1,156 @@
-{"commands":[{"name":"help","usage":["help [--xml] [--format FORMAT] [--raw] [--] [<command_name>]"],"description":"Displays help for a command","help":"The <info>help<\/info> command displays help for a given command:\n\n <info>php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the <info>list<\/info> command.","definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output help as XML","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"list","usage":["list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]"],"description":"Lists commands","help":"The <info>list<\/info> command lists all commands:\n\n <info>php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n <info>php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n <info>php app\/console list --raw<\/info>","definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output list as XML","default":false},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"}}}}],"namespaces":[{"id":"_global","commands":["help","list"]}]}
+{
+ "commands": [
+ {
+ "name": "help",
+ "hidden": false,
+ "usage": [
+ "help [--format FORMAT] [--raw] [--] [<command_name>]"
+ ],
+ "description": "Displays help for a command",
+ "help": "The <info>help<\/info> command displays help for a given command:\n\n <info>php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the <info>list<\/info> command.",
+ "definition": {
+ "arguments": {
+ "command_name": {
+ "name": "command_name",
+ "is_required": false,
+ "is_array": false,
+ "description": "The command name",
+ "default": "help"
+ }
+ },
+ "options": {
+ "format": {
+ "name": "--format",
+ "shortcut": "",
+ "accept_value": true,
+ "is_value_required": true,
+ "is_multiple": false,
+ "description": "The output format (txt, xml, json, or md)",
+ "default": "txt"
+ },
+ "raw": {
+ "name": "--raw",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "To output raw command help",
+ "default": false
+ },
+ "help": {
+ "name": "--help",
+ "shortcut": "-h",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Display this help message",
+ "default": false
+ },
+ "quiet": {
+ "name": "--quiet",
+ "shortcut": "-q",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Do not output any message",
+ "default": false
+ },
+ "verbose": {
+ "name": "--verbose",
+ "shortcut": "-v|-vv|-vvv",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
+ "default": false
+ },
+ "version": {
+ "name": "--version",
+ "shortcut": "-V",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Display this application version",
+ "default": false
+ },
+ "ansi": {
+ "name": "--ansi",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Force ANSI output",
+ "default": false
+ },
+ "no-ansi": {
+ "name": "--no-ansi",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Disable ANSI output",
+ "default": false
+ },
+ "no-interaction": {
+ "name": "--no-interaction",
+ "shortcut": "-n",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Do not ask any interactive question",
+ "default": false
+ }
+ }
+ }
+ },
+ {
+ "name": "list",
+ "hidden": false,
+ "usage": [
+ "list [--raw] [--format FORMAT] [--] [<namespace>]"
+ ],
+ "description": "Lists commands",
+ "help": "The <info>list<\/info> command lists all commands:\n\n <info>php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n <info>php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n <info>php app\/console list --raw<\/info>",
+ "definition": {
+ "arguments": {
+ "namespace": {
+ "name": "namespace",
+ "is_required": false,
+ "is_array": false,
+ "description": "The namespace name",
+ "default": null
+ }
+ },
+ "options": {
+ "raw": {
+ "name": "--raw",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "To output raw command list",
+ "default": false
+ },
+ "format": {
+ "name": "--format",
+ "shortcut": "",
+ "accept_value": true,
+ "is_value_required": true,
+ "is_multiple": false,
+ "description": "The output format (txt, xml, json, or md)",
+ "default": "txt"
+ }
+ }
+ }
+ }
+ ],
+ "namespaces": [
+ {
+ "id": "_global",
+ "commands": [
+ "help",
+ "list"
+ ]
+ }
+ ]
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.md b/vendor/symfony/console/Tests/Fixtures/application_1.md
index 82a605da..b46c975a 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_1.md
+++ b/vendor/symfony/console/Tests/Fixtures/application_1.md
@@ -1,201 +1,172 @@
-UNKNOWN
-=======
+Console Tool
+============
-* help
-* list
+* [`help`](#help)
+* [`list`](#list)
-help
-----
+`help`
+------
-* Description: Displays help for a command
-* Usage:
+Displays help for a command
- * `help [--xml] [--format FORMAT] [--raw] [--] [<command_name>]`
+### Usage
-The <info>help</info> command displays help for a given command:
+* `help [--format FORMAT] [--raw] [--] [<command_name>]`
- <info>php app/console help list</info>
+The help command displays help for a given command:
-You can also output the help in other formats by using the <comment>--format</comment> option:
+ php app/console help list
- <info>php app/console help --format=xml list</info>
+You can also output the help in other formats by using the --format option:
-To display the list of available commands, please use the <info>list</info> command.
+ php app/console help --format=xml list
-### Arguments:
+To display the list of available commands, please use the list command.
-**command_name:**
+### Arguments
+
+#### `command_name`
+
+The command name
-* Name: command_name
* Is required: no
* Is array: no
-* Description: The command name
* Default: `'help'`
-### Options:
-
-**xml:**
+### Options
-* Name: `--xml`
-* Shortcut: <none>
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Description: To output help as XML
-* Default: `false`
+#### `--format`
-**format:**
+The output format (txt, xml, json, or md)
-* Name: `--format`
-* Shortcut: <none>
* Accept value: yes
* Is value required: yes
* Is multiple: no
-* Description: The output format (txt, xml, json, or md)
* Default: `'txt'`
-**raw:**
+#### `--raw`
+
+To output raw command help
-* Name: `--raw`
-* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: To output raw command help
* Default: `false`
-**help:**
+#### `--help|-h`
+
+Display this help message
-* Name: `--help`
-* Shortcut: `-h`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Display this help message
* Default: `false`
-**quiet:**
+#### `--quiet|-q`
+
+Do not output any message
-* Name: `--quiet`
-* Shortcut: `-q`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Do not output any message
* Default: `false`
-**verbose:**
+#### `--verbose|-v|-vv|-vvv`
+
+Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-* Name: `--verbose`
-* Shortcut: `-v|-vv|-vvv`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Default: `false`
-**version:**
+#### `--version|-V`
+
+Display this application version
-* Name: `--version`
-* Shortcut: `-V`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Display this application version
* Default: `false`
-**ansi:**
+#### `--ansi`
+
+Force ANSI output
-* Name: `--ansi`
-* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Force ANSI output
* Default: `false`
-**no-ansi:**
+#### `--no-ansi`
+
+Disable ANSI output
-* Name: `--no-ansi`
-* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Disable ANSI output
* Default: `false`
-**no-interaction:**
+#### `--no-interaction|-n`
+
+Do not ask any interactive question
-* Name: `--no-interaction`
-* Shortcut: `-n`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Do not ask any interactive question
* Default: `false`
-list
-----
+`list`
+------
-* Description: Lists commands
-* Usage:
+Lists commands
- * `list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]`
+### Usage
-The <info>list</info> command lists all commands:
+* `list [--raw] [--format FORMAT] [--] [<namespace>]`
- <info>php app/console list</info>
+The list command lists all commands:
+
+ php app/console list
You can also display the commands for a specific namespace:
- <info>php app/console list test</info>
+ php app/console list test
-You can also output the information in other formats by using the <comment>--format</comment> option:
+You can also output the information in other formats by using the --format option:
- <info>php app/console list --format=xml</info>
+ php app/console list --format=xml
It's also possible to get raw list of commands (useful for embedding command runner):
- <info>php app/console list --raw</info>
+ php app/console list --raw
+
+### Arguments
-### Arguments:
+#### `namespace`
-**namespace:**
+The namespace name
-* Name: namespace
* Is required: no
* Is array: no
-* Description: The namespace name
* Default: `NULL`
-### Options:
+### Options
-**xml:**
+#### `--raw`
-* Name: `--xml`
-* Shortcut: <none>
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Description: To output list as XML
-* Default: `false`
+To output raw command list
-**raw:**
-
-* Name: `--raw`
-* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: To output raw command list
* Default: `false`
-**format:**
+#### `--format`
+
+The output format (txt, xml, json, or md)
-* Name: `--format`
-* Shortcut: <none>
* Accept value: yes
* Is value required: yes
* Is multiple: no
-* Description: The output format (txt, xml, json, or md)
* Default: `'txt'`
diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.txt b/vendor/symfony/console/Tests/Fixtures/application_1.txt
index c4cf8f21..8a7b47e0 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_1.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_1.txt
@@ -1,4 +1,4 @@
-<info>Console Tool</info>
+Console Tool
<comment>Usage:</comment>
command [options] [arguments]
diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.xml b/vendor/symfony/console/Tests/Fixtures/application_1.xml
index 35d1db4d..a0bd076c 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_1.xml
+++ b/vendor/symfony/console/Tests/Fixtures/application_1.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<symfony>
<commands>
- <command id="help" name="help">
+ <command id="help" name="help" hidden="0">
<usages>
- <usage>help [--xml] [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
+ <usage>help [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
</usages>
<description>Displays help for a command</description>
<help>The &lt;info&gt;help&lt;/info&gt; command displays help for a given command:
@@ -24,9 +24,6 @@
</argument>
</arguments>
<options>
- <option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>To output help as XML</description>
- </option>
<option name="--format" shortcut="" accept_value="1" is_value_required="1" is_multiple="0">
<description>The output format (txt, xml, json, or md)</description>
<defaults>
@@ -59,9 +56,9 @@
</option>
</options>
</command>
- <command id="list" name="list">
+ <command id="list" name="list" hidden="0">
<usages>
- <usage>list [--xml] [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
+ <usage>list [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
</usages>
<description>Lists commands</description>
<help>The &lt;info&gt;list&lt;/info&gt; command lists all commands:
@@ -86,9 +83,6 @@
</argument>
</arguments>
<options>
- <option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>To output list as XML</description>
- </option>
<option name="--raw" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>To output raw command list</description>
</option>
diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.json b/vendor/symfony/console/Tests/Fixtures/application_2.json
index e47a7a96..4777a60b 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_2.json
+++ b/vendor/symfony/console/Tests/Fixtures/application_2.json
@@ -1 +1,509 @@
-{"commands":[{"name":"help","usage":["help [--xml] [--format FORMAT] [--raw] [--] [<command_name>]"],"description":"Displays help for a command","help":"The <info>help<\/info> command displays help for a given command:\n\n <info>php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the <info>list<\/info> command.","definition":{"arguments":{"command_name":{"name":"command_name","is_required":false,"is_array":false,"description":"The command name","default":"help"}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output help as XML","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command help","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"list","usage":["list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]"],"description":"Lists commands","help":"The <info>list<\/info> command lists all commands:\n\n <info>php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n <info>php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n <info>php app\/console list --raw<\/info>","definition":{"arguments":{"namespace":{"name":"namespace","is_required":false,"is_array":false,"description":"The namespace name","default":null}},"options":{"xml":{"name":"--xml","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output list as XML","default":false},"raw":{"name":"--raw","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"To output raw command list","default":false},"format":{"name":"--format","shortcut":"","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"The output format (txt, xml, json, or md)","default":"txt"}}}},{"name":"descriptor:command1","usage":["descriptor:command1", "alias1", "alias2"],"description":"command 1 description","help":"command 1 help","definition":{"arguments":[],"options":{"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}},{"name":"descriptor:command2","usage":["descriptor:command2 [-o|--option_name] [--] <argument_name>", "descriptor:command2 -o|--option_name <argument_name>", "descriptor:command2 <argument_name>"],"description":"command 2 description","help":"command 2 help","definition":{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false},"help":{"name":"--help","shortcut":"-h","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this help message","default":false},"quiet":{"name":"--quiet","shortcut":"-q","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not output any message","default":false},"verbose":{"name":"--verbose","shortcut":"-v|-vv|-vvv","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug","default":false},"version":{"name":"--version","shortcut":"-V","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Display this application version","default":false},"ansi":{"name":"--ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Force ANSI output","default":false},"no-ansi":{"name":"--no-ansi","shortcut":"","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Disable ANSI output","default":false},"no-interaction":{"name":"--no-interaction","shortcut":"-n","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"Do not ask any interactive question","default":false}}}}],"namespaces":[{"id":"_global","commands":["alias1","alias2","help","list"]},{"id":"descriptor","commands":["descriptor:command1","descriptor:command2"]}]} \ No newline at end of file
+{
+ "application": {
+ "name": "My Symfony application",
+ "version": "v1.0"
+ },
+ "commands": [
+ {
+ "name": "help",
+ "hidden": false,
+ "usage": [
+ "help [--format FORMAT] [--raw] [--] [<command_name>]"
+ ],
+ "description": "Displays help for a command",
+ "help": "The <info>help<\/info> command displays help for a given command:\n\n <info>php app\/console help list<\/info>\n\nYou can also output the help in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console help --format=xml list<\/info>\n\nTo display the list of available commands, please use the <info>list<\/info> command.",
+ "definition": {
+ "arguments": {
+ "command_name": {
+ "name": "command_name",
+ "is_required": false,
+ "is_array": false,
+ "description": "The command name",
+ "default": "help"
+ }
+ },
+ "options": {
+ "format": {
+ "name": "--format",
+ "shortcut": "",
+ "accept_value": true,
+ "is_value_required": true,
+ "is_multiple": false,
+ "description": "The output format (txt, xml, json, or md)",
+ "default": "txt"
+ },
+ "raw": {
+ "name": "--raw",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "To output raw command help",
+ "default": false
+ },
+ "help": {
+ "name": "--help",
+ "shortcut": "-h",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Display this help message",
+ "default": false
+ },
+ "quiet": {
+ "name": "--quiet",
+ "shortcut": "-q",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Do not output any message",
+ "default": false
+ },
+ "verbose": {
+ "name": "--verbose",
+ "shortcut": "-v|-vv|-vvv",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
+ "default": false
+ },
+ "version": {
+ "name": "--version",
+ "shortcut": "-V",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Display this application version",
+ "default": false
+ },
+ "ansi": {
+ "name": "--ansi",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Force ANSI output",
+ "default": false
+ },
+ "no-ansi": {
+ "name": "--no-ansi",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Disable ANSI output",
+ "default": false
+ },
+ "no-interaction": {
+ "name": "--no-interaction",
+ "shortcut": "-n",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Do not ask any interactive question",
+ "default": false
+ }
+ }
+ }
+ },
+ {
+ "name": "list",
+ "hidden": false,
+ "usage": [
+ "list [--raw] [--format FORMAT] [--] [<namespace>]"
+ ],
+ "description": "Lists commands",
+ "help": "The <info>list<\/info> command lists all commands:\n\n <info>php app\/console list<\/info>\n\nYou can also display the commands for a specific namespace:\n\n <info>php app\/console list test<\/info>\n\nYou can also output the information in other formats by using the <comment>--format<\/comment> option:\n\n <info>php app\/console list --format=xml<\/info>\n\nIt's also possible to get raw list of commands (useful for embedding command runner):\n\n <info>php app\/console list --raw<\/info>",
+ "definition": {
+ "arguments": {
+ "namespace": {
+ "name": "namespace",
+ "is_required": false,
+ "is_array": false,
+ "description": "The namespace name",
+ "default": null
+ }
+ },
+ "options": {
+ "raw": {
+ "name": "--raw",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "To output raw command list",
+ "default": false
+ },
+ "format": {
+ "name": "--format",
+ "shortcut": "",
+ "accept_value": true,
+ "is_value_required": true,
+ "is_multiple": false,
+ "description": "The output format (txt, xml, json, or md)",
+ "default": "txt"
+ }
+ }
+ }
+ },
+ {
+ "name": "descriptor:command1",
+ "hidden": false,
+ "usage": [
+ "descriptor:command1",
+ "alias1",
+ "alias2"
+ ],
+ "description": "command 1 description",
+ "help": "command 1 help",
+ "definition": {
+ "arguments": [],
+ "options": {
+ "help": {
+ "name": "--help",
+ "shortcut": "-h",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Display this help message",
+ "default": false
+ },
+ "quiet": {
+ "name": "--quiet",
+ "shortcut": "-q",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Do not output any message",
+ "default": false
+ },
+ "verbose": {
+ "name": "--verbose",
+ "shortcut": "-v|-vv|-vvv",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
+ "default": false
+ },
+ "version": {
+ "name": "--version",
+ "shortcut": "-V",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Display this application version",
+ "default": false
+ },
+ "ansi": {
+ "name": "--ansi",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Force ANSI output",
+ "default": false
+ },
+ "no-ansi": {
+ "name": "--no-ansi",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Disable ANSI output",
+ "default": false
+ },
+ "no-interaction": {
+ "name": "--no-interaction",
+ "shortcut": "-n",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Do not ask any interactive question",
+ "default": false
+ }
+ }
+ }
+ },
+ {
+ "name": "descriptor:command2",
+ "hidden": false,
+ "usage": [
+ "descriptor:command2 [-o|--option_name] [--] <argument_name>",
+ "descriptor:command2 -o|--option_name <argument_name>",
+ "descriptor:command2 <argument_name>"
+ ],
+ "description": "command 2 description",
+ "help": "command 2 help",
+ "definition": {
+ "arguments": {
+ "argument_name": {
+ "name": "argument_name",
+ "is_required": true,
+ "is_array": false,
+ "description": "",
+ "default": null
+ }
+ },
+ "options": {
+ "option_name": {
+ "name": "--option_name",
+ "shortcut": "-o",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "",
+ "default": false
+ },
+ "help": {
+ "name": "--help",
+ "shortcut": "-h",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Display this help message",
+ "default": false
+ },
+ "quiet": {
+ "name": "--quiet",
+ "shortcut": "-q",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Do not output any message",
+ "default": false
+ },
+ "verbose": {
+ "name": "--verbose",
+ "shortcut": "-v|-vv|-vvv",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
+ "default": false
+ },
+ "version": {
+ "name": "--version",
+ "shortcut": "-V",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Display this application version",
+ "default": false
+ },
+ "ansi": {
+ "name": "--ansi",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Force ANSI output",
+ "default": false
+ },
+ "no-ansi": {
+ "name": "--no-ansi",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Disable ANSI output",
+ "default": false
+ },
+ "no-interaction": {
+ "name": "--no-interaction",
+ "shortcut": "-n",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Do not ask any interactive question",
+ "default": false
+ }
+ }
+ }
+ },
+ {
+ "name": "descriptor:command3",
+ "hidden": true,
+ "usage": [
+ "descriptor:command3"
+ ],
+ "description": "command 3 description",
+ "help": "command 3 help",
+ "definition": {
+ "arguments": {},
+ "options": {
+ "help": {
+ "name": "--help",
+ "shortcut": "-h",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Display this help message",
+ "default": false
+ },
+ "quiet": {
+ "name": "--quiet",
+ "shortcut": "-q",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Do not output any message",
+ "default": false
+ },
+ "verbose": {
+ "name": "--verbose",
+ "shortcut": "-v|-vv|-vvv",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
+ "default": false
+ },
+ "version": {
+ "name": "--version",
+ "shortcut": "-V",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Display this application version",
+ "default": false
+ },
+ "ansi": {
+ "name": "--ansi",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Force ANSI output",
+ "default": false
+ },
+ "no-ansi": {
+ "name": "--no-ansi",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Disable ANSI output",
+ "default": false
+ },
+ "no-interaction": {
+ "name": "--no-interaction",
+ "shortcut": "-n",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Do not ask any interactive question",
+ "default": false
+ }
+ }
+ }
+ },
+ {
+ "name": "descriptor:command4",
+ "hidden": false,
+ "usage": [
+ "descriptor:command4",
+ "descriptor:alias_command4",
+ "command4:descriptor"
+ ],
+ "description": null,
+ "help": "",
+ "definition": {
+ "arguments": {},
+ "options": {
+ "help": {
+ "name": "--help",
+ "shortcut": "-h",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Display this help message",
+ "default": false
+ },
+ "quiet": {
+ "name": "--quiet",
+ "shortcut": "-q",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Do not output any message",
+ "default": false
+ },
+ "verbose": {
+ "name": "--verbose",
+ "shortcut": "-v|-vv|-vvv",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug",
+ "default": false
+ },
+ "version": {
+ "name": "--version",
+ "shortcut": "-V",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Display this application version",
+ "default": false
+ },
+ "ansi": {
+ "name": "--ansi",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Force ANSI output",
+ "default": false
+ },
+ "no-ansi": {
+ "name": "--no-ansi",
+ "shortcut": "",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Disable ANSI output",
+ "default": false
+ },
+ "no-interaction": {
+ "name": "--no-interaction",
+ "shortcut": "-n",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "Do not ask any interactive question",
+ "default": false
+ }
+ }
+ }
+ }
+ ],
+ "namespaces": [
+ {
+ "id": "_global",
+ "commands": [
+ "alias1",
+ "alias2",
+ "help",
+ "list"
+ ]
+ },
+ {
+ "id": "command4",
+ "commands": [
+ "command4:descriptor"
+ ]
+ },
+ {
+ "id": "descriptor",
+ "commands": [
+ "descriptor:alias_command4",
+ "descriptor:command1",
+ "descriptor:command2",
+ "descriptor:command3",
+ "descriptor:command4"
+ ]
+ }
+ ]
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.md b/vendor/symfony/console/Tests/Fixtures/application_2.md
index f031c9e5..5b4896c0 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_2.md
+++ b/vendor/symfony/console/Tests/Fixtures/application_2.md
@@ -1,396 +1,431 @@
-My Symfony application
-======================
+My Symfony application v1.0
+===========================
-* alias1
-* alias2
-* help
-* list
+* [`alias1`](#descriptorcommand1)
+* [`alias2`](#descriptorcommand1)
+* [`help`](#help)
+* [`list`](#list)
+
+**command4:**
+
+* [`command4:descriptor`](#descriptorcommand4)
**descriptor:**
-* descriptor:command1
-* descriptor:command2
+* [`descriptor:alias_command4`](#descriptorcommand4)
+* [`descriptor:command1`](#descriptorcommand1)
+* [`descriptor:command2`](#descriptorcommand2)
+* [`descriptor:command4`](#descriptorcommand4)
+
+`help`
+------
-help
-----
+Displays help for a command
-* Description: Displays help for a command
-* Usage:
+### Usage
- * `help [--xml] [--format FORMAT] [--raw] [--] [<command_name>]`
+* `help [--format FORMAT] [--raw] [--] [<command_name>]`
-The <info>help</info> command displays help for a given command:
+The help command displays help for a given command:
- <info>php app/console help list</info>
+ php app/console help list
-You can also output the help in other formats by using the <comment>--format</comment> option:
+You can also output the help in other formats by using the --format option:
- <info>php app/console help --format=xml list</info>
+ php app/console help --format=xml list
-To display the list of available commands, please use the <info>list</info> command.
+To display the list of available commands, please use the list command.
-### Arguments:
+### Arguments
-**command_name:**
+#### `command_name`
+
+The command name
-* Name: command_name
* Is required: no
* Is array: no
-* Description: The command name
* Default: `'help'`
-### Options:
-
-**xml:**
+### Options
-* Name: `--xml`
-* Shortcut: <none>
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Description: To output help as XML
-* Default: `false`
+#### `--format`
-**format:**
+The output format (txt, xml, json, or md)
-* Name: `--format`
-* Shortcut: <none>
* Accept value: yes
* Is value required: yes
* Is multiple: no
-* Description: The output format (txt, xml, json, or md)
* Default: `'txt'`
-**raw:**
+#### `--raw`
+
+To output raw command help
-* Name: `--raw`
-* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: To output raw command help
* Default: `false`
-**help:**
+#### `--help|-h`
+
+Display this help message
-* Name: `--help`
-* Shortcut: `-h`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Display this help message
* Default: `false`
-**quiet:**
+#### `--quiet|-q`
+
+Do not output any message
-* Name: `--quiet`
-* Shortcut: `-q`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Do not output any message
* Default: `false`
-**verbose:**
+#### `--verbose|-v|-vv|-vvv`
+
+Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-* Name: `--verbose`
-* Shortcut: `-v|-vv|-vvv`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Default: `false`
-**version:**
+#### `--version|-V`
+
+Display this application version
-* Name: `--version`
-* Shortcut: `-V`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Display this application version
* Default: `false`
-**ansi:**
+#### `--ansi`
+
+Force ANSI output
-* Name: `--ansi`
-* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Force ANSI output
* Default: `false`
-**no-ansi:**
+#### `--no-ansi`
+
+Disable ANSI output
-* Name: `--no-ansi`
-* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Disable ANSI output
* Default: `false`
-**no-interaction:**
+#### `--no-interaction|-n`
+
+Do not ask any interactive question
-* Name: `--no-interaction`
-* Shortcut: `-n`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Do not ask any interactive question
* Default: `false`
-list
-----
+`list`
+------
+
+Lists commands
-* Description: Lists commands
-* Usage:
+### Usage
- * `list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]`
+* `list [--raw] [--format FORMAT] [--] [<namespace>]`
-The <info>list</info> command lists all commands:
+The list command lists all commands:
- <info>php app/console list</info>
+ php app/console list
You can also display the commands for a specific namespace:
- <info>php app/console list test</info>
+ php app/console list test
-You can also output the information in other formats by using the <comment>--format</comment> option:
+You can also output the information in other formats by using the --format option:
- <info>php app/console list --format=xml</info>
+ php app/console list --format=xml
It's also possible to get raw list of commands (useful for embedding command runner):
- <info>php app/console list --raw</info>
+ php app/console list --raw
-### Arguments:
+### Arguments
-**namespace:**
+#### `namespace`
+
+The namespace name
-* Name: namespace
* Is required: no
* Is array: no
-* Description: The namespace name
* Default: `NULL`
-### Options:
-
-**xml:**
+### Options
-* Name: `--xml`
-* Shortcut: <none>
-* Accept value: no
-* Is value required: no
-* Is multiple: no
-* Description: To output list as XML
-* Default: `false`
+#### `--raw`
-**raw:**
+To output raw command list
-* Name: `--raw`
-* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: To output raw command list
* Default: `false`
-**format:**
+#### `--format`
+
+The output format (txt, xml, json, or md)
-* Name: `--format`
-* Shortcut: <none>
* Accept value: yes
* Is value required: yes
* Is multiple: no
-* Description: The output format (txt, xml, json, or md)
* Default: `'txt'`
-descriptor:command1
--------------------
+`descriptor:command1`
+---------------------
+
+command 1 description
-* Description: command 1 description
-* Usage:
+### Usage
- * `descriptor:command1`
- * `alias1`
- * `alias2`
+* `descriptor:command1`
+* `alias1`
+* `alias2`
command 1 help
-### Options:
+### Options
+
+#### `--help|-h`
-**help:**
+Display this help message
-* Name: `--help`
-* Shortcut: `-h`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Display this help message
* Default: `false`
-**quiet:**
+#### `--quiet|-q`
+
+Do not output any message
-* Name: `--quiet`
-* Shortcut: `-q`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Do not output any message
* Default: `false`
-**verbose:**
+#### `--verbose|-v|-vv|-vvv`
+
+Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-* Name: `--verbose`
-* Shortcut: `-v|-vv|-vvv`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Default: `false`
-**version:**
+#### `--version|-V`
+
+Display this application version
-* Name: `--version`
-* Shortcut: `-V`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Display this application version
* Default: `false`
-**ansi:**
+#### `--ansi`
+
+Force ANSI output
-* Name: `--ansi`
-* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Force ANSI output
* Default: `false`
-**no-ansi:**
+#### `--no-ansi`
+
+Disable ANSI output
-* Name: `--no-ansi`
-* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Disable ANSI output
* Default: `false`
-**no-interaction:**
+#### `--no-interaction|-n`
+
+Do not ask any interactive question
-* Name: `--no-interaction`
-* Shortcut: `-n`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Do not ask any interactive question
* Default: `false`
-descriptor:command2
--------------------
+`descriptor:command2`
+---------------------
-* Description: command 2 description
-* Usage:
+command 2 description
- * `descriptor:command2 [-o|--option_name] [--] <argument_name>`
- * `descriptor:command2 -o|--option_name <argument_name>`
- * `descriptor:command2 <argument_name>`
+### Usage
+
+* `descriptor:command2 [-o|--option_name] [--] <argument_name>`
+* `descriptor:command2 -o|--option_name <argument_name>`
+* `descriptor:command2 <argument_name>`
command 2 help
-### Arguments:
+### Arguments
-**argument_name:**
+#### `argument_name`
-* Name: argument_name
* Is required: yes
* Is array: no
-* Description: <none>
* Default: `NULL`
-### Options:
+### Options
+
+#### `--option_name|-o`
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--help|-h`
-**option_name:**
+Display this help message
-* Name: `--option_name`
-* Shortcut: `-o`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: <none>
* Default: `false`
-**help:**
+#### `--quiet|-q`
+
+Do not output any message
-* Name: `--help`
-* Shortcut: `-h`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Display this help message
* Default: `false`
-**quiet:**
+#### `--verbose|-v|-vv|-vvv`
+
+Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-* Name: `--quiet`
-* Shortcut: `-q`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Do not output any message
* Default: `false`
-**verbose:**
+#### `--version|-V`
+
+Display this application version
-* Name: `--verbose`
-* Shortcut: `-v|-vv|-vvv`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
* Default: `false`
-**version:**
+#### `--ansi`
+
+Force ANSI output
-* Name: `--version`
-* Shortcut: `-V`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Display this application version
* Default: `false`
-**ansi:**
+#### `--no-ansi`
+
+Disable ANSI output
-* Name: `--ansi`
-* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Force ANSI output
* Default: `false`
-**no-ansi:**
+#### `--no-interaction|-n`
+
+Do not ask any interactive question
-* Name: `--no-ansi`
-* Shortcut: <none>
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Disable ANSI output
* Default: `false`
-**no-interaction:**
+`descriptor:command4`
+---------------------
+
+### Usage
+
+* `descriptor:command4`
+* `descriptor:alias_command4`
+* `command4:descriptor`
+
+
+### Options
+
+#### `--help|-h`
+
+Display this help message
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--quiet|-q`
+
+Do not output any message
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--verbose|-v|-vv|-vvv`
+
+Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--version|-V`
+
+Display this application version
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--ansi`
+
+Force ANSI output
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--no-ansi`
+
+Disable ANSI output
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--no-interaction|-n`
+
+Do not ask any interactive question
-* Name: `--no-interaction`
-* Shortcut: `-n`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: Do not ask any interactive question
* Default: `false`
diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.txt b/vendor/symfony/console/Tests/Fixtures/application_2.txt
index 292aa829..d624f194 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_2.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_2.txt
@@ -1,4 +1,4 @@
-<info>My Symfony application</info> version <comment>v1.0</comment>
+My Symfony application <info>v1.0</info>
<comment>Usage:</comment>
command [options] [arguments]
@@ -13,10 +13,9 @@
<info>-v|vv|vvv, --verbose</info> Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
<comment>Available commands:</comment>
- <info>alias1</info> command 1 description
- <info>alias2</info> command 1 description
<info>help</info> Displays help for a command
<info>list</info> Lists commands
<comment>descriptor</comment>
- <info>descriptor:command1</info> command 1 description
+ <info>descriptor:command1</info> [alias1|alias2] command 1 description
<info>descriptor:command2</info> command 2 description
+ <info>descriptor:command4</info> [descriptor:alias_command4|command4:descriptor]
diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.xml b/vendor/symfony/console/Tests/Fixtures/application_2.xml
index bc8ab219..5f0f98bd 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_2.xml
+++ b/vendor/symfony/console/Tests/Fixtures/application_2.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<symfony name="My Symfony application" version="v1.0">
<commands>
- <command id="help" name="help">
+ <command id="help" name="help" hidden="0">
<usages>
- <usage>help [--xml] [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
+ <usage>help [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
</usages>
<description>Displays help for a command</description>
<help>The &lt;info&gt;help&lt;/info&gt; command displays help for a given command:
@@ -24,9 +24,6 @@
</argument>
</arguments>
<options>
- <option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>To output help as XML</description>
- </option>
<option name="--format" shortcut="" accept_value="1" is_value_required="1" is_multiple="0">
<description>The output format (txt, xml, json, or md)</description>
<defaults>
@@ -59,9 +56,9 @@
</option>
</options>
</command>
- <command id="list" name="list">
+ <command id="list" name="list" hidden="0">
<usages>
- <usage>list [--xml] [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
+ <usage>list [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
</usages>
<description>Lists commands</description>
<help>The &lt;info&gt;list&lt;/info&gt; command lists all commands:
@@ -86,9 +83,6 @@
</argument>
</arguments>
<options>
- <option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>To output list as XML</description>
- </option>
<option name="--raw" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
<description>To output raw command list</description>
</option>
@@ -100,7 +94,7 @@
</option>
</options>
</command>
- <command id="descriptor:command1" name="descriptor:command1">
+ <command id="descriptor:command1" name="descriptor:command1" hidden="0">
<usages>
<usage>descriptor:command1</usage>
<usage>alias1</usage>
@@ -133,7 +127,7 @@
</option>
</options>
</command>
- <command id="descriptor:command2" name="descriptor:command2">
+ <command id="descriptor:command2" name="descriptor:command2" hidden="0">
<usages>
<usage>descriptor:command2 [-o|--option_name] [--] &lt;argument_name&gt;</usage>
<usage>descriptor:command2 -o|--option_name &lt;argument_name&gt;</usage>
@@ -174,6 +168,70 @@
</option>
</options>
</command>
+ <command id="descriptor:command3" name="descriptor:command3" hidden="1">
+ <usages>
+ <usage>descriptor:command3</usage>
+ </usages>
+ <description>command 3 description</description>
+ <help>command 3 help</help>
+ <arguments/>
+ <options>
+ <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
+ <description>Display this help message</description>
+ </option>
+ <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" shortcuts="-v|-vv|-vvv" 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>
+ </option>
+ <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+ <description>Force ANSI output</description>
+ </option>
+ <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+ <description>Disable ANSI output</description>
+ </option>
+ <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
+ <description>Do not ask any interactive question</description>
+ </option>
+ </options>
+ </command>
+ <command id="descriptor:command4" name="descriptor:command4" hidden="0">
+ <usages>
+ <usage>descriptor:command4</usage>
+ <usage>descriptor:alias_command4</usage>
+ <usage>command4:descriptor</usage>
+ </usages>
+ <description></description>
+ <help></help>
+ <arguments/>
+ <options>
+ <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
+ <description>Display this help message</description>
+ </option>
+ <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" shortcuts="-v|-vv|-vvv" 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>
+ </option>
+ <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+ <description>Force ANSI output</description>
+ </option>
+ <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
+ <description>Disable ANSI output</description>
+ </option>
+ <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
+ <description>Do not ask any interactive question</description>
+ </option>
+ </options>
+ </command>
</commands>
<namespaces>
<namespace id="_global">
@@ -182,9 +240,15 @@
<command>help</command>
<command>list</command>
</namespace>
+ <namespace id="command4">
+ <command>command4:descriptor</command>
+ </namespace>
<namespace id="descriptor">
+ <command>descriptor:alias_command4</command>
<command>descriptor:command1</command>
<command>descriptor:command2</command>
+ <command>descriptor:command3</command>
+ <command>descriptor:command4</command>
</namespace>
</namespaces>
</symfony>
diff --git a/vendor/symfony/console/Tests/Fixtures/application_asxml1.txt b/vendor/symfony/console/Tests/Fixtures/application_asxml1.txt
deleted file mode 100644
index 8277d9e6..00000000
--- a/vendor/symfony/console/Tests/Fixtures/application_asxml1.txt
+++ /dev/null
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<symfony>
- <commands>
- <command id="help" name="help">
- <usages>
- <usage>help [--xml] [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
- </usages>
- <description>Displays help for a command</description>
- <help>The &lt;info&gt;help&lt;/info&gt; command displays help for a given command:
-
- &lt;info&gt;php app/console help list&lt;/info&gt;
-
- You can also output the help in other formats by using the &lt;comment&gt;--format&lt;/comment&gt; option:
-
- &lt;info&gt;php app/console help --format=xml list&lt;/info&gt;
-
- To display the list of available commands, please use the &lt;info&gt;list&lt;/info&gt; command.</help>
- <arguments>
- <argument name="command_name" is_required="0" is_array="0">
- <description>The command name</description>
- <defaults>
- <default>help</default>
- </defaults>
- </argument>
- </arguments>
- <options>
- <option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>To output help as XML</description>
- </option>
- <option name="--format" shortcut="" accept_value="1" is_value_required="1" is_multiple="0">
- <description>The output format (txt, xml, json, or md)</description>
- <defaults>
- <default>txt</default>
- </defaults>
- </option>
- <option name="--raw" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>To output raw command help</description>
- </option>
- <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Display this help message</description>
- </option>
- <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" shortcuts="-v|-vv|-vvv" 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>
- </option>
- <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Force ANSI output</description>
- </option>
- <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Disable ANSI output</description>
- </option>
- <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Do not ask any interactive question</description>
- </option>
- </options>
- </command>
- <command id="list" name="list">
- <usages>
- <usage>list [--xml] [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
- </usages>
- <description>Lists commands</description>
- <help>The &lt;info&gt;list&lt;/info&gt; command lists all commands:
-
- &lt;info&gt;php app/console list&lt;/info&gt;
-
- You can also display the commands for a specific namespace:
-
- &lt;info&gt;php app/console list test&lt;/info&gt;
-
- You can also output the information in other formats by using the &lt;comment&gt;--format&lt;/comment&gt; option:
-
- &lt;info&gt;php app/console list --format=xml&lt;/info&gt;
-
- It's also possible to get raw list of commands (useful for embedding command runner):
-
- &lt;info&gt;php app/console list --raw&lt;/info&gt;</help>
- <arguments>
- <argument name="namespace" is_required="0" is_array="0">
- <description>The namespace name</description>
- <defaults/>
- </argument>
- </arguments>
- <options>
- <option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>To output list as XML</description>
- </option>
- <option name="--raw" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>To output raw command list</description>
- </option>
- <option name="--format" shortcut="" accept_value="1" is_value_required="1" is_multiple="0">
- <description>The output format (txt, xml, json, or md)</description>
- <defaults>
- <default>txt</default>
- </defaults>
- </option>
- </options>
- </command>
- <command id="foo:bar" name="foo:bar">
- <usages>
- <usage>foo:bar</usage>
- <usage>afoobar</usage>
- </usages>
- <description>The foo:bar command</description>
- <help>The foo:bar command</help>
- <arguments/>
- <options>
- <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Display this help message</description>
- </option>
- <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" shortcuts="-v|-vv|-vvv" 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>
- </option>
- <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Force ANSI output</description>
- </option>
- <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Disable ANSI output</description>
- </option>
- <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Do not ask any interactive question</description>
- </option>
- </options>
- </command>
- </commands>
- <namespaces>
- <namespace id="_global">
- <command>afoobar</command>
- <command>help</command>
- <command>list</command>
- </namespace>
- <namespace id="foo">
- <command>foo:bar</command>
- </namespace>
- </namespaces>
-</symfony>
diff --git a/vendor/symfony/console/Tests/Fixtures/application_asxml2.txt b/vendor/symfony/console/Tests/Fixtures/application_asxml2.txt
deleted file mode 100644
index 93d6d4e9..00000000
--- a/vendor/symfony/console/Tests/Fixtures/application_asxml2.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<symfony>
- <commands namespace="foo">
- <command id="foo:bar" name="foo:bar">
- <usages>
- <usage>foo:bar</usage>
- <usage>afoobar</usage>
- </usages>
- <description>The foo:bar command</description>
- <help>The foo:bar command</help>
- <arguments/>
- <options>
- <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Display this help message</description>
- </option>
- <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" shortcuts="-v|-vv|-vvv" 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>
- </option>
- <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Force ANSI output</description>
- </option>
- <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Disable ANSI output</description>
- </option>
- <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Do not ask any interactive question</description>
- </option>
- </options>
- </command>
- </commands>
-</symfony>
diff --git a/vendor/symfony/console/Tests/Fixtures/application_astext2.txt b/vendor/symfony/console/Tests/Fixtures/application_filtered_namespace.txt
index c99ccdda..3bca2700 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_astext2.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_filtered_namespace.txt
@@ -1,4 +1,4 @@
-<info>Console Tool</info>
+My Symfony application <info>v1.0</info>
<comment>Usage:</comment>
command [options] [arguments]
@@ -12,5 +12,5 @@
<info>-n, --no-interaction</info> Do not ask any interactive question
<info>-v|vv|vvv, --verbose</info> Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-<comment>Available commands for the "foo" namespace:</comment>
- <info>foo:bar</info> The foo:bar command
+<comment>Available commands for the "command4" namespace:</comment>
+ <info>command4:descriptor</info>
diff --git a/vendor/symfony/console/Tests/Fixtures/application_gethelp.txt b/vendor/symfony/console/Tests/Fixtures/application_gethelp.txt
index 0c16e3c8..5a5920d0 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_gethelp.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_gethelp.txt
@@ -1 +1 @@
-<info>Console Tool</info> \ No newline at end of file
+Console Tool \ No newline at end of file
diff --git a/vendor/symfony/console/Tests/Fixtures/application_mbstring.md b/vendor/symfony/console/Tests/Fixtures/application_mbstring.md
new file mode 100644
index 00000000..f34e5585
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_mbstring.md
@@ -0,0 +1,269 @@
+MbString åpplicätion
+====================
+
+* [`help`](#help)
+* [`list`](#list)
+
+**descriptor:**
+
+* [`descriptor:åèä`](#descriptoråèä)
+
+`help`
+------
+
+Displays help for a command
+
+### Usage
+
+* `help [--format FORMAT] [--raw] [--] [<command_name>]`
+
+The help command displays help for a given command:
+
+ php app/console help list
+
+You can also output the help in other formats by using the --format option:
+
+ php app/console help --format=xml list
+
+To display the list of available commands, please use the list command.
+
+### Arguments
+
+#### `command_name`
+
+The command name
+
+* Is required: no
+* Is array: no
+* Default: `'help'`
+
+### Options
+
+#### `--format`
+
+The output format (txt, xml, json, or md)
+
+* Accept value: yes
+* Is value required: yes
+* Is multiple: no
+* Default: `'txt'`
+
+#### `--raw`
+
+To output raw command help
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--help|-h`
+
+Display this help message
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--quiet|-q`
+
+Do not output any message
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--verbose|-v|-vv|-vvv`
+
+Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--version|-V`
+
+Display this application version
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--ansi`
+
+Force ANSI output
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--no-ansi`
+
+Disable ANSI output
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--no-interaction|-n`
+
+Do not ask any interactive question
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+`list`
+------
+
+Lists commands
+
+### Usage
+
+* `list [--raw] [--format FORMAT] [--] [<namespace>]`
+
+The list command lists all commands:
+
+ php app/console list
+
+You can also display the commands for a specific namespace:
+
+ php app/console list test
+
+You can also output the information in other formats by using the --format option:
+
+ php app/console list --format=xml
+
+It's also possible to get raw list of commands (useful for embedding command runner):
+
+ php app/console list --raw
+
+### Arguments
+
+#### `namespace`
+
+The namespace name
+
+* Is required: no
+* Is array: no
+* Default: `NULL`
+
+### Options
+
+#### `--raw`
+
+To output raw command list
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--format`
+
+The output format (txt, xml, json, or md)
+
+* Accept value: yes
+* Is value required: yes
+* Is multiple: no
+* Default: `'txt'`
+
+`descriptor:åèä`
+----------------
+
+command åèä description
+
+### Usage
+
+* `descriptor:åèä [-o|--option_åèä] [--] <argument_åèä>`
+* `descriptor:åèä -o|--option_name <argument_name>`
+* `descriptor:åèä <argument_name>`
+
+command åèä help
+
+### Arguments
+
+#### `argument_åèä`
+
+* Is required: yes
+* Is array: no
+* Default: `NULL`
+
+### Options
+
+#### `--option_åèä|-o`
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--help|-h`
+
+Display this help message
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--quiet|-q`
+
+Do not output any message
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--verbose|-v|-vv|-vvv`
+
+Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--version|-V`
+
+Display this application version
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--ansi`
+
+Force ANSI output
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--no-ansi`
+
+Disable ANSI output
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
+
+#### `--no-interaction|-n`
+
+Do not ask any interactive question
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
diff --git a/vendor/symfony/console/Tests/Fixtures/application_astext1.txt b/vendor/symfony/console/Tests/Fixtures/application_mbstring.txt
index 19dacb23..b409d188 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_astext1.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_mbstring.txt
@@ -1,4 +1,4 @@
-<info>Console Tool</info>
+MbString åpplicätion
<comment>Usage:</comment>
command [options] [arguments]
@@ -13,8 +13,7 @@
<info>-v|vv|vvv, --verbose</info> Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
<comment>Available commands:</comment>
- <info>afoobar</info> The foo:bar command
- <info>help</info> Displays help for a command
- <info>list</info> Lists commands
- <comment>foo</comment>
- <info>foo:bar</info> The foo:bar command
+ <info>help</info> Displays help for a command
+ <info>list</info> Lists commands
+ <comment>descriptor</comment>
+ <info>descriptor:åèä</info> command åèä description
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt
index 919cec42..1df5bd64 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt
@@ -1,6 +1,5 @@
-
- [Symfony\Component\Console\Exception\CommandNotFoundException]
- Command "foo" is not defined.
-
+
+ Command "foo" is not defined.
+
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt
index d9e93da4..932063d7 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt
@@ -1,8 +1,7 @@
-
- [Symfony\Component\Console\Exception\InvalidOptionException]
- The "--foo" option does not exist.
-
+
+ The "--foo" option does not exist.
+
-list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]
+list [--raw] [--format FORMAT] [--] [<namespace>]
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt
index 8276137b..5366b84f 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt
@@ -1,16 +1,16 @@
-
- [Exception]
- Third exception comment
-
+In Foo3Command.php line 26:
+
+ Third exception <fg=blue;bg=red>comment</>
+
-
- [Exception]
- Second exception comment
-
+In Foo3Command.php line 23:
+
+ Second exception <comment>comment</comment>
+
+In Foo3Command.php line 21:
- [Exception]
First exception <p>this is html</p>
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt
index b4a7b018..59937092 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt
@@ -1,17 +1,17 @@
- 
- [Exception] 
- Third exception comment 
- 
+In Foo3Command.php line 26:
+ 
+ Third exception <fg=blue;bg=red>comment</> 
+ 
- 
- [Exception] 
- Second exception comment 
- 
+In Foo3Command.php line 23:
+ 
+ Second exception <comment>comment</comment> 
+ 
+In Foo3Command.php line 21:
 
- [Exception] 
- First exception <p>this is html</p> 
+ First exception <p>this is html</p> 
 
foo3:bar
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt
index cb080e9c..548a13e5 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt
@@ -1,7 +1,6 @@
-
- [Symfony\Component\Console\Exception\CommandNotFoundException]
- Command "foo" is not define
- d.
-
+
+ Command "foo" is not define
+ d.
+
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1.txt
index 1ba5f8fd..01986c91 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1.txt
@@ -1,6 +1,6 @@
+In ApplicationTest.php line 716:
- [Exception]
エラーメッセージ
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt
index 20644251..ba057d8c 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt
@@ -1,6 +1,6 @@
+In ApplicationTest.php line 716:
 
- [Exception] 
 エラーメッセージ 
 
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt
index e41fcfcf..66b52c87 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt
@@ -1,6 +1,6 @@
+In ApplicationTest.php line 730:
- [Exception]
コマンドの実行中にエラーが
発生しました。
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_escapeslines.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_escapeslines.txt
new file mode 100644
index 00000000..326ee42f
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception_escapeslines.txt
@@ -0,0 +1,9 @@
+
+In ApplicationTest.php line 744:
+
+ dont break here <
+ info>!</info>
+
+
+foo
+
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_linebreaks.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_linebreaks.txt
new file mode 100644
index 00000000..88ee0f29
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception_linebreaks.txt
@@ -0,0 +1,11 @@
+
+In ApplicationTest.php line 761:
+
+ line 1 with extra spaces
+ line 2
+
+ line 4
+
+
+foo
+
diff --git a/vendor/symfony/console/Tests/Fixtures/application_run2.txt b/vendor/symfony/console/Tests/Fixtures/application_run2.txt
index d28b928e..65a685d0 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_run2.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_run2.txt
@@ -1,29 +1,26 @@
Usage:
- help [options] [--] [<command_name>]
+ list [options] [--] [<namespace>]
Arguments:
- command The command to execute
- command_name The command name [default: "help"]
+ namespace The namespace name
Options:
- --xml To output help as XML
- --format=FORMAT The output format (txt, xml, json, or md) [default: "txt"]
- --raw To output raw command help
- -h, --help Display this help message
- -q, --quiet Do not output any message
- -V, --version Display this application version
- --ansi Force ANSI output
- --no-ansi Disable ANSI output
- -n, --no-interaction Do not ask any interactive question
- -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
+ --raw To output raw command list
+ --format=FORMAT The output format (txt, xml, json, or md) [default: "txt"]
Help:
- The help command displays help for a given command:
-
- php app/console help list
-
- You can also output the help in other formats by using the --format option:
-
- php app/console help --format=xml list
-
- To display the list of available commands, please use the list command.
+ The list command lists all commands:
+
+ php app/console list
+
+ You can also display the commands for a specific namespace:
+
+ php app/console list test
+
+ You can also output the information in other formats by using the --format option:
+
+ php app/console list --format=xml
+
+ It's also possible to get raw list of commands (useful for embedding command runner):
+
+ php app/console list --raw
diff --git a/vendor/symfony/console/Tests/Fixtures/application_run3.txt b/vendor/symfony/console/Tests/Fixtures/application_run3.txt
index bc51995f..65a685d0 100644
--- a/vendor/symfony/console/Tests/Fixtures/application_run3.txt
+++ b/vendor/symfony/console/Tests/Fixtures/application_run3.txt
@@ -5,23 +5,22 @@ Arguments:
namespace The namespace name
Options:
- --xml To output list as XML
--raw To output raw command list
--format=FORMAT The output format (txt, xml, json, or md) [default: "txt"]
Help:
- The list command lists all commands:
-
- php app/console list
-
- You can also display the commands for a specific namespace:
-
- php app/console list test
-
- You can also output the information in other formats by using the --format option:
-
- php app/console list --format=xml
-
- It's also possible to get raw list of commands (useful for embedding command runner):
-
- php app/console list --raw
+ The list command lists all commands:
+
+ php app/console list
+
+ You can also display the commands for a specific namespace:
+
+ php app/console list test
+
+ You can also output the information in other formats by using the --format option:
+
+ php app/console list --format=xml
+
+ It's also possible to get raw list of commands (useful for embedding command runner):
+
+ php app/console list --raw
diff --git a/vendor/symfony/console/Tests/Fixtures/command_1.json b/vendor/symfony/console/Tests/Fixtures/command_1.json
index 20f310b4..09087900 100644
--- a/vendor/symfony/console/Tests/Fixtures/command_1.json
+++ b/vendor/symfony/console/Tests/Fixtures/command_1.json
@@ -1 +1,15 @@
-{"name":"descriptor:command1","usage":["descriptor:command1", "alias1", "alias2"],"description":"command 1 description","help":"command 1 help","definition":{"arguments":[],"options":[]}}
+{
+ "name": "descriptor:command1",
+ "hidden": false,
+ "usage": [
+ "descriptor:command1",
+ "alias1",
+ "alias2"
+ ],
+ "description": "command 1 description",
+ "help": "command 1 help",
+ "definition": {
+ "arguments": [],
+ "options": []
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/command_1.md b/vendor/symfony/console/Tests/Fixtures/command_1.md
index 34ed3ea7..e9a0180b 100644
--- a/vendor/symfony/console/Tests/Fixtures/command_1.md
+++ b/vendor/symfony/console/Tests/Fixtures/command_1.md
@@ -1,11 +1,12 @@
-descriptor:command1
--------------------
+`descriptor:command1`
+---------------------
-* Description: command 1 description
-* Usage:
+command 1 description
- * `descriptor:command1`
- * `alias1`
- * `alias2`
+### Usage
+
+* `descriptor:command1`
+* `alias1`
+* `alias2`
command 1 help
diff --git a/vendor/symfony/console/Tests/Fixtures/command_1.txt b/vendor/symfony/console/Tests/Fixtures/command_1.txt
index 28e14a05..e5e93ee0 100644
--- a/vendor/symfony/console/Tests/Fixtures/command_1.txt
+++ b/vendor/symfony/console/Tests/Fixtures/command_1.txt
@@ -4,4 +4,4 @@
alias2
<comment>Help:</comment>
- command 1 help
+ command 1 help
diff --git a/vendor/symfony/console/Tests/Fixtures/command_1.xml b/vendor/symfony/console/Tests/Fixtures/command_1.xml
index 838b9bd9..fa0cca08 100644
--- a/vendor/symfony/console/Tests/Fixtures/command_1.xml
+++ b/vendor/symfony/console/Tests/Fixtures/command_1.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<command id="descriptor:command1" name="descriptor:command1">
+<command id="descriptor:command1" name="descriptor:command1" hidden="0">
<usages>
<usage>descriptor:command1</usage>
<usage>alias1</usage>
diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.json b/vendor/symfony/console/Tests/Fixtures/command_2.json
index 38edd1e2..8a1ec023 100644
--- a/vendor/symfony/console/Tests/Fixtures/command_2.json
+++ b/vendor/symfony/console/Tests/Fixtures/command_2.json
@@ -1 +1,33 @@
-{"name":"descriptor:command2","usage":["descriptor:command2 [-o|--option_name] [--] <argument_name>", "descriptor:command2 -o|--option_name <argument_name>", "descriptor:command2 <argument_name>"],"description":"command 2 description","help":"command 2 help","definition":{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}}}}
+{
+ "name": "descriptor:command2",
+ "hidden": false,
+ "usage": [
+ "descriptor:command2 [-o|--option_name] [--] <argument_name>",
+ "descriptor:command2 -o|--option_name <argument_name>",
+ "descriptor:command2 <argument_name>"
+ ],
+ "description": "command 2 description",
+ "help": "command 2 help",
+ "definition": {
+ "arguments": {
+ "argument_name": {
+ "name": "argument_name",
+ "is_required": true,
+ "is_array": false,
+ "description": "",
+ "default": null
+ }
+ },
+ "options": {
+ "option_name": {
+ "name": "--option_name",
+ "shortcut": "-o",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "",
+ "default": false
+ }
+ }
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.md b/vendor/symfony/console/Tests/Fixtures/command_2.md
index 6f538b64..41f51f01 100644
--- a/vendor/symfony/console/Tests/Fixtures/command_2.md
+++ b/vendor/symfony/console/Tests/Fixtures/command_2.md
@@ -1,33 +1,29 @@
-descriptor:command2
--------------------
+`descriptor:command2`
+---------------------
-* Description: command 2 description
-* Usage:
+command 2 description
- * `descriptor:command2 [-o|--option_name] [--] <argument_name>`
- * `descriptor:command2 -o|--option_name <argument_name>`
- * `descriptor:command2 <argument_name>`
+### Usage
+
+* `descriptor:command2 [-o|--option_name] [--] <argument_name>`
+* `descriptor:command2 -o|--option_name <argument_name>`
+* `descriptor:command2 <argument_name>`
command 2 help
-### Arguments:
+### Arguments
-**argument_name:**
+#### `argument_name`
-* Name: argument_name
* Is required: yes
* Is array: no
-* Description: <none>
* Default: `NULL`
-### Options:
+### Options
-**option_name:**
+#### `--option_name|-o`
-* Name: `--option_name`
-* Shortcut: `-o`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: <none>
* Default: `false`
diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.txt b/vendor/symfony/console/Tests/Fixtures/command_2.txt
index 72f7ce05..2864c7bd 100644
--- a/vendor/symfony/console/Tests/Fixtures/command_2.txt
+++ b/vendor/symfony/console/Tests/Fixtures/command_2.txt
@@ -1,7 +1,7 @@
<comment>Usage:</comment>
- descriptor:command2 [options] [--] <argument_name>
- descriptor:command2 -o|--option_name <argument_name>
- descriptor:command2 <argument_name>
+ descriptor:command2 [options] [--] \<argument_name>
+ descriptor:command2 -o|--option_name \<argument_name>
+ descriptor:command2 \<argument_name>
<comment>Arguments:</comment>
<info>argument_name</info>
@@ -10,4 +10,4 @@
<info>-o, --option_name</info>
<comment>Help:</comment>
- command 2 help
+ command 2 help
diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.xml b/vendor/symfony/console/Tests/Fixtures/command_2.xml
index 67364caa..ae69e2f4 100644
--- a/vendor/symfony/console/Tests/Fixtures/command_2.xml
+++ b/vendor/symfony/console/Tests/Fixtures/command_2.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<command id="descriptor:command2" name="descriptor:command2">
+<command id="descriptor:command2" name="descriptor:command2" hidden="0">
<usages>
<usage>descriptor:command2 [-o|--option_name] [--] &lt;argument_name&gt;</usage>
<usage>descriptor:command2 -o|--option_name &lt;argument_name&gt;</usage>
diff --git a/vendor/symfony/console/Tests/Fixtures/command_astext.txt b/vendor/symfony/console/Tests/Fixtures/command_astext.txt
deleted file mode 100644
index 7e206388..00000000
--- a/vendor/symfony/console/Tests/Fixtures/command_astext.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-<comment>Usage:</comment>
- namespace:name
- name
-
-<comment>Arguments:</comment>
- <info>command</info> The command to execute
-
-<comment>Options:</comment>
- <info>-h, --help</info> Display this help message
- <info>-q, --quiet</info> Do not output any message
- <info>-V, --version</info> Display this application version
- <info> --ansi</info> Force ANSI output
- <info> --no-ansi</info> Disable ANSI output
- <info>-n, --no-interaction</info> Do not ask any interactive question
- <info>-v|vv|vvv, --verbose</info> Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
-
-<comment>Help:</comment>
- help
diff --git a/vendor/symfony/console/Tests/Fixtures/command_asxml.txt b/vendor/symfony/console/Tests/Fixtures/command_asxml.txt
deleted file mode 100644
index 5e776238..00000000
--- a/vendor/symfony/console/Tests/Fixtures/command_asxml.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<command id="namespace:name" name="namespace:name">
- <usages>
- <usage>namespace:name</usage>
- <usage>name</usage>
- </usages>
- <description>description</description>
- <help>help</help>
- <arguments>
- <argument name="command" is_required="1" is_array="0">
- <description>The command to execute</description>
- <defaults/>
- </argument>
- </arguments>
- <options>
- <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Display this help message</description>
- </option>
- <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" shortcuts="-v|-vv|-vvv" 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>
- </option>
- <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Force ANSI output</description>
- </option>
- <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Disable ANSI output</description>
- </option>
- <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
- <description>Do not ask any interactive question</description>
- </option>
- </options>
-</command>
diff --git a/vendor/symfony/console/Tests/Fixtures/command_mbstring.md b/vendor/symfony/console/Tests/Fixtures/command_mbstring.md
new file mode 100644
index 00000000..7ef40d7b
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/command_mbstring.md
@@ -0,0 +1,29 @@
+`descriptor:åèä`
+----------------
+
+command åèä description
+
+### Usage
+
+* `descriptor:åèä [-o|--option_åèä] [--] <argument_åèä>`
+* `descriptor:åèä -o|--option_name <argument_name>`
+* `descriptor:åèä <argument_name>`
+
+command åèä help
+
+### Arguments
+
+#### `argument_åèä`
+
+* Is required: yes
+* Is array: no
+* Default: `NULL`
+
+### Options
+
+#### `--option_åèä|-o`
+
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Default: `false`
diff --git a/vendor/symfony/console/Tests/Fixtures/command_mbstring.txt b/vendor/symfony/console/Tests/Fixtures/command_mbstring.txt
new file mode 100644
index 00000000..cde457dc
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/command_mbstring.txt
@@ -0,0 +1,13 @@
+<comment>Usage:</comment>
+ descriptor:åèä [options] [--] \<argument_åèä>
+ descriptor:åèä -o|--option_name \<argument_name>
+ descriptor:åèä \<argument_name>
+
+<comment>Arguments:</comment>
+ <info>argument_åèä</info>
+
+<comment>Options:</comment>
+ <info>-o, --option_åèä</info>
+
+<comment>Help:</comment>
+ command åèä help
diff --git a/vendor/symfony/console/Tests/Fixtures/definition_astext.txt b/vendor/symfony/console/Tests/Fixtures/definition_astext.txt
deleted file mode 100644
index 0431c072..00000000
--- a/vendor/symfony/console/Tests/Fixtures/definition_astext.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-<comment>Arguments:</comment>
- <info>foo</info> The foo argument
- <info>baz</info> The baz argument<comment> [default: true]</comment>
- <info>bar</info> The bar argument<comment> [default: ["http://foo.com/"]]</comment>
-
-<comment>Options:</comment>
- <info>-f, --foo=FOO</info> The foo option
- <info> --baz[=BAZ]</info> The baz option<comment> [default: false]</comment>
- <info>-b, --bar[=BAR]</info> The bar option<comment> [default: "bar"]</comment>
- <info> --qux[=QUX]</info> The qux option<comment> [default: ["http://foo.com/","bar"]]</comment><comment> (multiple values allowed)</comment>
- <info> --qux2[=QUX2]</info> The qux2 option<comment> [default: {"foo":"bar"}]</comment><comment> (multiple values allowed)</comment> \ No newline at end of file
diff --git a/vendor/symfony/console/Tests/Fixtures/definition_asxml.txt b/vendor/symfony/console/Tests/Fixtures/definition_asxml.txt
deleted file mode 100644
index eec8c079..00000000
--- a/vendor/symfony/console/Tests/Fixtures/definition_asxml.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definition>
- <arguments>
- <argument name="foo" is_required="0" is_array="0">
- <description>The foo argument</description>
- <defaults/>
- </argument>
- <argument name="baz" is_required="0" is_array="0">
- <description>The baz argument</description>
- <defaults>
- <default>true</default>
- </defaults>
- </argument>
- <argument name="bar" is_required="0" is_array="1">
- <description>The bar argument</description>
- <defaults>
- <default>bar</default>
- </defaults>
- </argument>
- </arguments>
- <options>
- <option name="--foo" shortcut="-f" accept_value="1" is_value_required="1" is_multiple="0">
- <description>The foo option</description>
- <defaults/>
- </option>
- <option name="--baz" shortcut="" accept_value="1" is_value_required="0" is_multiple="0">
- <description>The baz option</description>
- <defaults>
- <default>false</default>
- </defaults>
- </option>
- <option name="--bar" shortcut="-b" accept_value="1" is_value_required="0" is_multiple="0">
- <description>The bar option</description>
- <defaults>
- <default>bar</default>
- </defaults>
- </option>
- </options>
-</definition>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_1.json b/vendor/symfony/console/Tests/Fixtures/input_argument_1.json
index b8173b6b..0ab93296 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_1.json
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_1.json
@@ -1 +1,7 @@
-{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}
+{
+ "name": "argument_name",
+ "is_required": true,
+ "is_array": false,
+ "description": "",
+ "default": null
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_1.md b/vendor/symfony/console/Tests/Fixtures/input_argument_1.md
index 88f311ab..7516cbd4 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_1.md
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_1.md
@@ -1,7 +1,5 @@
-**argument_name:**
+#### `argument_name`
-* Name: argument_name
* Is required: yes
* Is array: no
-* Description: <none>
* Default: `NULL`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_2.json b/vendor/symfony/console/Tests/Fixtures/input_argument_2.json
index ef06b09a..7450016f 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_2.json
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_2.json
@@ -1 +1,7 @@
-{"name":"argument_name","is_required":false,"is_array":true,"description":"argument description","default":[]}
+{
+ "name": "argument_name",
+ "is_required": false,
+ "is_array": true,
+ "description": "argument description",
+ "default": []
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_2.md b/vendor/symfony/console/Tests/Fixtures/input_argument_2.md
index 3cdb00cc..2e7e7580 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_2.md
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_2.md
@@ -1,7 +1,7 @@
-**argument_name:**
+#### `argument_name`
+
+argument description
-* Name: argument_name
* Is required: no
* Is array: yes
-* Description: argument description
* Default: `array ()`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_3.json b/vendor/symfony/console/Tests/Fixtures/input_argument_3.json
index de8484e6..9a83c5a5 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_3.json
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_3.json
@@ -1 +1,7 @@
-{"name":"argument_name","is_required":false,"is_array":false,"description":"argument description","default":"default_value"}
+{
+ "name": "argument_name",
+ "is_required": false,
+ "is_array": false,
+ "description": "argument description",
+ "default": "default_value"
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_3.md b/vendor/symfony/console/Tests/Fixtures/input_argument_3.md
index be1c443a..b0dd8785 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_3.md
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_3.md
@@ -1,7 +1,7 @@
-**argument_name:**
+#### `argument_name`
+
+argument description
-* Name: argument_name
* Is required: no
* Is array: no
-* Description: argument description
* Default: `'default_value'`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_4.json b/vendor/symfony/console/Tests/Fixtures/input_argument_4.json
index 8067a4d1..cbcb19b3 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_4.json
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_4.json
@@ -1 +1,7 @@
-{"name":"argument_name","is_required":true,"is_array":false,"description":"multiline argument description","default":null}
+{
+ "name": "argument_name",
+ "is_required": true,
+ "is_array": false,
+ "description": "multiline argument description",
+ "default": null
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_4.md b/vendor/symfony/console/Tests/Fixtures/input_argument_4.md
index f026ab37..b9bb7edc 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_4.md
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_4.md
@@ -1,8 +1,8 @@
-**argument_name:**
+#### `argument_name`
+
+multiline
+argument description
-* Name: argument_name
* Is required: yes
* Is array: no
-* Description: multiline
- argument description
* Default: `NULL`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt
index aa74e8ce..fc7d669a 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt
@@ -1,2 +1,2 @@
<info>argument_name</info> multiline
- argument description
+ argument description
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.json b/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.json
new file mode 100644
index 00000000..b61ecf7b
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.json
@@ -0,0 +1,7 @@
+{
+ "name": "argument_name",
+ "is_required": false,
+ "is_array": false,
+ "description": "argument description",
+ "default": "INF"
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.md b/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.md
new file mode 100644
index 00000000..4f4d9b16
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.md
@@ -0,0 +1,7 @@
+#### `argument_name`
+
+argument description
+
+* Is required: no
+* Is array: no
+* Default: `INF`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.txt
new file mode 100644
index 00000000..c32d768c
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.txt
@@ -0,0 +1 @@
+ <info>argument_name</info> argument description<comment> [default: INF]</comment>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.xml
new file mode 100644
index 00000000..d4572600
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_with_default_inf_value.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<argument name="argument_name" is_required="0" is_array="0">
+ <description>argument description</description>
+ <defaults>
+ <default>INF</default>
+ </defaults>
+</argument>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.json b/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.json
new file mode 100644
index 00000000..93342351
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.json
@@ -0,0 +1,7 @@
+{
+ "name": "argument_name",
+ "is_required": false,
+ "is_array": false,
+ "description": "argument description",
+ "default": "<comment>style</>"
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.md b/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.md
new file mode 100644
index 00000000..a2be9672
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.md
@@ -0,0 +1,7 @@
+#### `argument_name`
+
+argument description
+
+* Is required: no
+* Is array: no
+* Default: `'style'`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.txt
new file mode 100644
index 00000000..35384a6b
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.txt
@@ -0,0 +1 @@
+ <info>argument_name</info> argument description<comment> [default: "\<comment>style\</>"]</comment>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.xml
new file mode 100644
index 00000000..73332c79
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_with_style.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<argument name="argument_name" is_required="0" is_array="0">
+ <description>argument description</description>
+ <defaults>
+ <default>&lt;comment&gt;style&lt;/&gt;</default>
+ </defaults>
+</argument>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_1.json b/vendor/symfony/console/Tests/Fixtures/input_definition_1.json
index c7a7d838..44aa2c2e 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_1.json
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_1.json
@@ -1 +1,4 @@
-{"arguments":[],"options":[]}
+{
+ "arguments": [],
+ "options": []
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_2.json b/vendor/symfony/console/Tests/Fixtures/input_definition_2.json
index 9964a55a..7cfd57e5 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_2.json
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_2.json
@@ -1 +1,12 @@
-{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":[]}
+{
+ "arguments": {
+ "argument_name": {
+ "name": "argument_name",
+ "is_required": true,
+ "is_array": false,
+ "description": "",
+ "default": null
+ }
+ },
+ "options": []
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_2.md b/vendor/symfony/console/Tests/Fixtures/input_definition_2.md
index 923191cd..ffc2bbbe 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_2.md
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_2.md
@@ -1,9 +1,7 @@
-### Arguments:
+### Arguments
-**argument_name:**
+#### `argument_name`
-* Name: argument_name
* Is required: yes
* Is array: no
-* Description: <none>
* Default: `NULL`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_3.json b/vendor/symfony/console/Tests/Fixtures/input_definition_3.json
index 6a860560..3b3cf73c 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_3.json
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_3.json
@@ -1 +1,14 @@
-{"arguments":[],"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}}}
+{
+ "arguments": [],
+ "options": {
+ "option_name": {
+ "name": "--option_name",
+ "shortcut": "-o",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "",
+ "default": false
+ }
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_3.md b/vendor/symfony/console/Tests/Fixtures/input_definition_3.md
index 40fd7b0a..11f7cd6b 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_3.md
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_3.md
@@ -1,11 +1,8 @@
-### Options:
+### Options
-**option_name:**
+#### `--option_name|-o`
-* Name: `--option_name`
-* Shortcut: `-o`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: <none>
* Default: `false`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_4.json b/vendor/symfony/console/Tests/Fixtures/input_definition_4.json
index c5a0019f..d4a51e82 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_4.json
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_4.json
@@ -1 +1,22 @@
-{"arguments":{"argument_name":{"name":"argument_name","is_required":true,"is_array":false,"description":"","default":null}},"options":{"option_name":{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}}}
+{
+ "arguments": {
+ "argument_name": {
+ "name": "argument_name",
+ "is_required": true,
+ "is_array": false,
+ "description": "",
+ "default": null
+ }
+ },
+ "options": {
+ "option_name": {
+ "name": "--option_name",
+ "shortcut": "-o",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "",
+ "default": false
+ }
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_4.md b/vendor/symfony/console/Tests/Fixtures/input_definition_4.md
index a31feea4..c4f947f5 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_definition_4.md
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_4.md
@@ -1,21 +1,16 @@
-### Arguments:
+### Arguments
-**argument_name:**
+#### `argument_name`
-* Name: argument_name
* Is required: yes
* Is array: no
-* Description: <none>
* Default: `NULL`
-### Options:
+### Options
-**option_name:**
+#### `--option_name|-o`
-* Name: `--option_name`
-* Shortcut: `-o`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: <none>
* Default: `false`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_1.json b/vendor/symfony/console/Tests/Fixtures/input_option_1.json
index 60c5b56c..f86bf967 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_option_1.json
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_1.json
@@ -1 +1,9 @@
-{"name":"--option_name","shortcut":"-o","accept_value":false,"is_value_required":false,"is_multiple":false,"description":"","default":false}
+{
+ "name": "--option_name",
+ "shortcut": "-o",
+ "accept_value": false,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "",
+ "default": false
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_1.md b/vendor/symfony/console/Tests/Fixtures/input_option_1.md
index 6f9e9a7e..c544a4e6 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_option_1.md
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_1.md
@@ -1,9 +1,6 @@
-**option_name:**
+#### `--option_name|-o`
-* Name: `--option_name`
-* Shortcut: `-o`
* Accept value: no
* Is value required: no
* Is multiple: no
-* Description: <none>
* Default: `false`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_2.json b/vendor/symfony/console/Tests/Fixtures/input_option_2.json
index 04e4228e..32dbab21 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_option_2.json
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_2.json
@@ -1 +1,9 @@
-{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":false,"is_multiple":false,"description":"option description","default":"default_value"}
+{
+ "name": "--option_name",
+ "shortcut": "-o",
+ "accept_value": true,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "option description",
+ "default": "default_value"
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_2.md b/vendor/symfony/console/Tests/Fixtures/input_option_2.md
index 634ac0b0..293e6179 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_option_2.md
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_2.md
@@ -1,9 +1,8 @@
-**option_name:**
+#### `--option_name|-o`
+
+option description
-* Name: `--option_name`
-* Shortcut: `-o`
* Accept value: yes
* Is value required: no
* Is multiple: no
-* Description: option description
* Default: `'default_value'`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_3.json b/vendor/symfony/console/Tests/Fixtures/input_option_3.json
index c1ea120c..6d55a6ef 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_option_3.json
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_3.json
@@ -1 +1,9 @@
-{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"option description","default":null}
+{
+ "name": "--option_name",
+ "shortcut": "-o",
+ "accept_value": true,
+ "is_value_required": true,
+ "is_multiple": false,
+ "description": "option description",
+ "default": null
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_3.md b/vendor/symfony/console/Tests/Fixtures/input_option_3.md
index 34282896..7e89d697 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_option_3.md
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_3.md
@@ -1,9 +1,8 @@
-**option_name:**
+#### `--option_name|-o`
+
+option description
-* Name: `--option_name`
-* Shortcut: `-o`
* Accept value: yes
* Is value required: yes
* Is multiple: no
-* Description: option description
* Default: `NULL`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_4.json b/vendor/symfony/console/Tests/Fixtures/input_option_4.json
index 1b671d80..788a8ed4 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_option_4.json
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_4.json
@@ -1 +1,9 @@
-{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":false,"is_multiple":true,"description":"option description","default":[]}
+{
+ "name": "--option_name",
+ "shortcut": "-o",
+ "accept_value": true,
+ "is_value_required": false,
+ "is_multiple": true,
+ "description": "option description",
+ "default": []
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_4.md b/vendor/symfony/console/Tests/Fixtures/input_option_4.md
index 8ffba56e..7eb2d2ae 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_option_4.md
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_4.md
@@ -1,9 +1,8 @@
-**option_name:**
+#### `--option_name|-o`
+
+option description
-* Name: `--option_name`
-* Shortcut: `-o`
* Accept value: yes
* Is value required: no
* Is multiple: yes
-* Description: option description
* Default: `array ()`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_5.json b/vendor/symfony/console/Tests/Fixtures/input_option_5.json
index 35a1405f..9f34d832 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_option_5.json
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_5.json
@@ -1 +1,9 @@
-{"name":"--option_name","shortcut":"-o","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"multiline option description","default":null}
+{
+ "name": "--option_name",
+ "shortcut": "-o",
+ "accept_value": true,
+ "is_value_required": true,
+ "is_multiple": false,
+ "description": "multiline option description",
+ "default": null
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_5.md b/vendor/symfony/console/Tests/Fixtures/input_option_5.md
index 82f51cad..72ca4391 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_option_5.md
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_5.md
@@ -1,10 +1,9 @@
-**option_name:**
+#### `--option_name|-o`
+
+multiline
+option description
-* Name: `--option_name`
-* Shortcut: `-o`
* Accept value: yes
* Is value required: yes
* Is multiple: no
-* Description: multiline
- option description
* Default: `NULL`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_5.txt b/vendor/symfony/console/Tests/Fixtures/input_option_5.txt
index 4368883c..9563b4ca 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_option_5.txt
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_5.txt
@@ -1,2 +1,2 @@
<info>-o, --option_name=OPTION_NAME</info> multiline
- option description
+ option description
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_6.json b/vendor/symfony/console/Tests/Fixtures/input_option_6.json
index d84e8721..0638de03 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_option_6.json
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_6.json
@@ -1 +1,9 @@
-{"name":"--option_name","shortcut":"-o|-O","accept_value":true,"is_value_required":true,"is_multiple":false,"description":"option with multiple shortcuts","default":null}
+{
+ "name": "--option_name",
+ "shortcut": "-o|-O",
+ "accept_value": true,
+ "is_value_required": true,
+ "is_multiple": false,
+ "description": "option with multiple shortcuts",
+ "default": null
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_6.md b/vendor/symfony/console/Tests/Fixtures/input_option_6.md
index ed1ea1c8..87acd8b9 100644
--- a/vendor/symfony/console/Tests/Fixtures/input_option_6.md
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_6.md
@@ -1,9 +1,8 @@
-**option_name:**
+#### `--option_name|-o|-O`
+
+option with multiple shortcuts
-* Name: `--option_name`
-* Shortcut: `-o|-O`
* Accept value: yes
* Is value required: yes
* Is multiple: no
-* Description: option with multiple shortcuts
* Default: `NULL`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.json b/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.json
new file mode 100644
index 00000000..7c96ad30
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.json
@@ -0,0 +1,9 @@
+{
+ "name": "--option_name",
+ "shortcut": "-o",
+ "accept_value": true,
+ "is_value_required": false,
+ "is_multiple": false,
+ "description": "option description",
+ "default": "INF"
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.md b/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.md
new file mode 100644
index 00000000..c27e30a0
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.md
@@ -0,0 +1,8 @@
+#### `--option_name|-o`
+
+option description
+
+* Accept value: yes
+* Is value required: no
+* Is multiple: no
+* Default: `INF`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.txt b/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.txt
new file mode 100644
index 00000000..d467dcf4
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.txt
@@ -0,0 +1 @@
+ <info>-o, --option_name[=OPTION_NAME]</info> option description<comment> [default: INF]</comment>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.xml b/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.xml
new file mode 100644
index 00000000..5d1d2175
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_with_default_inf_value.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<option name="--option_name" shortcut="-o" accept_value="1" is_value_required="0" is_multiple="0">
+ <description>option description</description>
+ <defaults>
+ <default>INF</default>
+ </defaults>
+</option>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style.json b/vendor/symfony/console/Tests/Fixtures/input_option_with_style.json
new file mode 100644
index 00000000..df328bf8
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_with_style.json
@@ -0,0 +1,9 @@
+{
+ "name": "--option_name",
+ "shortcut": "-o",
+ "accept_value": true,
+ "is_value_required": true,
+ "is_multiple": false,
+ "description": "option description",
+ "default": "<comment>style</>"
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style.md b/vendor/symfony/console/Tests/Fixtures/input_option_with_style.md
new file mode 100644
index 00000000..e07a5643
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_with_style.md
@@ -0,0 +1,8 @@
+#### `--option_name|-o`
+
+option description
+
+* Accept value: yes
+* Is value required: yes
+* Is multiple: no
+* Default: `'style'`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style.txt b/vendor/symfony/console/Tests/Fixtures/input_option_with_style.txt
new file mode 100644
index 00000000..880a5351
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_with_style.txt
@@ -0,0 +1 @@
+ <info>-o, --option_name=OPTION_NAME</info> option description<comment> [default: "\<comment>style\</>"]</comment>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style.xml b/vendor/symfony/console/Tests/Fixtures/input_option_with_style.xml
new file mode 100644
index 00000000..764b9e65
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_with_style.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<option name="--option_name" shortcut="-o" accept_value="1" is_value_required="1" is_multiple="0">
+ <description>option description</description>
+ <defaults>
+ <default>&lt;comment&gt;style&lt;/&gt;</default>
+ </defaults>
+</option>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.json b/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.json
new file mode 100644
index 00000000..b1754550
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.json
@@ -0,0 +1,12 @@
+{
+ "name": "--option_name",
+ "shortcut": "-o",
+ "accept_value": true,
+ "is_value_required": true,
+ "is_multiple": true,
+ "description": "option description",
+ "default": [
+ "<comment>Hello</comment>",
+ "<info>world</info>"
+ ]
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.md b/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.md
new file mode 100644
index 00000000..16a045bc
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.md
@@ -0,0 +1,8 @@
+#### `--option_name|-o`
+
+option description
+
+* Accept value: yes
+* Is value required: yes
+* Is multiple: yes
+* Default: `array ( 0 => 'Hello', 1 => 'world',)`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.txt b/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.txt
new file mode 100644
index 00000000..265c18c5
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.txt
@@ -0,0 +1 @@
+ <info>-o, --option_name=OPTION_NAME</info> option description<comment> [default: ["\<comment>Hello\</comment>","\<info>world\</info>"]]</comment><comment> (multiple values allowed)</comment>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.xml b/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.xml
new file mode 100644
index 00000000..09dc8658
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_with_style_array.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<option name="--option_name" shortcut="-o" accept_value="1" is_value_required="1" is_multiple="1">
+ <description>option description</description>
+ <defaults>
+ <default>&lt;comment&gt;Hello&lt;/comment&gt;</default>
+ <default>&lt;info&gt;world&lt;/info&gt;</default>
+ </defaults>
+</option>
diff --git a/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php b/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php
index 774df268..6cd7c82b 100644
--- a/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php
+++ b/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php
@@ -11,10 +11,11 @@
namespace Symfony\Component\Console\Tests\Formatter;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Formatter\OutputFormatterStyleStack;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
-class OutputFormatterStyleStackTest extends \PHPUnit_Framework_TestCase
+class OutputFormatterStyleStackTest extends TestCase
{
public function testPush()
{
diff --git a/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php b/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php
index 0abfb3ce..ddf77902 100644
--- a/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php
+++ b/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php
@@ -11,9 +11,10 @@
namespace Symfony\Component\Console\Tests\Formatter;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
-class OutputFormatterStyleTest extends \PHPUnit_Framework_TestCase
+class OutputFormatterStyleTest extends TestCase
{
public function testConstructor()
{
@@ -40,7 +41,7 @@ class OutputFormatterStyleTest extends \PHPUnit_Framework_TestCase
$style->setForeground('default');
$this->assertEquals("\033[39mfoo\033[39m", $style->apply('foo'));
- $this->setExpectedException('InvalidArgumentException');
+ $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException');
$style->setForeground('undefined-color');
}
@@ -57,7 +58,7 @@ class OutputFormatterStyleTest extends \PHPUnit_Framework_TestCase
$style->setBackground('default');
$this->assertEquals("\033[49mfoo\033[49m", $style->apply('foo'));
- $this->setExpectedException('InvalidArgumentException');
+ $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('InvalidArgumentException');
$style->setBackground('undefined-color');
}
diff --git a/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php b/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php
index b8d5ca6d..a1aa8013 100644
--- a/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php
+++ b/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php
@@ -11,10 +11,11 @@
namespace Symfony\Component\Console\Tests\Formatter;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
-class OutputFormatterTest extends \PHPUnit_Framework_TestCase
+class OutputFormatterTest extends TestCase
{
public function testEmptyTag()
{
@@ -27,6 +28,9 @@ class OutputFormatterTest extends \PHPUnit_Framework_TestCase
$formatter = new OutputFormatter(true);
$this->assertEquals('foo<bar', $formatter->format('foo\\<bar'));
+ $this->assertEquals('foo << bar', $formatter->format('foo << bar'));
+ $this->assertEquals('foo << bar \\', $formatter->format('foo << bar \\'));
+ $this->assertEquals("foo << \033[32mbar \\ baz\033[39m \\", $formatter->format('foo << <info>bar \\ baz</info> \\'));
$this->assertEquals('<info>some info</info>', $formatter->format('\\<info>some info\\</info>'));
$this->assertEquals('\\<info>some info\\</info>', OutputFormatter::escape('<info>some info</info>'));
@@ -152,6 +156,67 @@ class OutputFormatterTest extends \PHPUnit_Framework_TestCase
$this->assertEquals("\033[34;41msome text\033[39;49m", $formatter->format('<fg=blue;bg=red>some text</fg=blue;bg=red>'));
}
+ /**
+ * @param string $tag
+ * @param string|null $expected
+ * @param string|null $input
+ *
+ * @dataProvider provideInlineStyleOptionsCases
+ */
+ public function testInlineStyleOptions($tag, $expected = null, $input = null)
+ {
+ $styleString = substr($tag, 1, -1);
+ $formatter = new OutputFormatter(true);
+ $method = new \ReflectionMethod($formatter, 'createStyleFromString');
+ $method->setAccessible(true);
+ $result = $method->invoke($formatter, $styleString);
+ if (null === $expected) {
+ $this->assertFalse($result);
+ $expected = $tag.$input.'</'.$styleString.'>';
+ $this->assertSame($expected, $formatter->format($expected));
+ } else {
+ /* @var OutputFormatterStyle $result */
+ $this->assertInstanceOf(OutputFormatterStyle::class, $result);
+ $this->assertSame($expected, $formatter->format($tag.$input.'</>'));
+ $this->assertSame($expected, $formatter->format($tag.$input.'</'.$styleString.'>'));
+ }
+ }
+
+ public function provideInlineStyleOptionsCases()
+ {
+ return array(
+ array('<unknown=_unknown_>'),
+ array('<unknown=_unknown_;a=1;b>'),
+ array('<fg=green;>', "\033[32m[test]\033[39m", '[test]'),
+ array('<fg=green;bg=blue;>', "\033[32;44ma\033[39;49m", 'a'),
+ array('<fg=green;options=bold>', "\033[32;1mb\033[39;22m", 'b'),
+ array('<fg=green;options=reverse;>', "\033[32;7m<a>\033[39;27m", '<a>'),
+ array('<fg=green;options=bold,underscore>', "\033[32;1;4mz\033[39;22;24m", 'z'),
+ array('<fg=green;options=bold,underscore,reverse;>', "\033[32;1;4;7md\033[39;22;24;27m", 'd'),
+ );
+ }
+
+ /**
+ * @group legacy
+ * @dataProvider provideInlineStyleTagsWithUnknownOptions
+ * @expectedDeprecation Unknown style options are deprecated since version 3.2 and will be removed in 4.0. Exception "Invalid option specified: "%s". Expected one of (bold, underscore, blink, reverse, conceal)".
+ */
+ public function testInlineStyleOptionsUnknownAreDeprecated($tag, $option)
+ {
+ $formatter = new OutputFormatter(true);
+ $formatter->format($tag);
+ }
+
+ public function provideInlineStyleTagsWithUnknownOptions()
+ {
+ return array(
+ array('<options=abc;>', 'abc'),
+ array('<options=abc,def;>', 'abc'),
+ array('<fg=green;options=xyz;>', 'xyz'),
+ array('<fg=green;options=efg,abc>', 'efg'),
+ );
+ }
+
public function testNonStyleTag()
{
$formatter = new OutputFormatter(true);
@@ -195,6 +260,9 @@ class OutputFormatterTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(
'some question', $formatter->format('<question>some question</question>')
);
+ $this->assertEquals(
+ 'some text with inline style', $formatter->format('<fg=red>some text with inline style</>')
+ );
$formatter->setDecorated(true);
@@ -210,6 +278,9 @@ class OutputFormatterTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(
"\033[30;46msome question\033[39;49m", $formatter->format('<question>some question</question>')
);
+ $this->assertEquals(
+ "\033[31msome text with inline style\033[39m", $formatter->format('<fg=red>some text with inline style</>')
+ );
}
public function testContentWithLineBreaks()
diff --git a/vendor/symfony/console/Tests/Helper/AbstractQuestionHelperTest.php b/vendor/symfony/console/Tests/Helper/AbstractQuestionHelperTest.php
new file mode 100644
index 00000000..56dd65f6
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/AbstractQuestionHelperTest.php
@@ -0,0 +1,34 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests\Helper;
+
+use PHPUnit\Framework\TestCase;
+use Symfony\Component\Console\Input\StreamableInputInterface;
+
+abstract class AbstractQuestionHelperTest extends TestCase
+{
+ protected function createStreamableInputInterfaceMock($stream = null, $interactive = true)
+ {
+ $mock = $this->getMockBuilder(StreamableInputInterface::class)->getMock();
+ $mock->expects($this->any())
+ ->method('isInteractive')
+ ->will($this->returnValue($interactive));
+
+ if ($stream) {
+ $mock->expects($this->any())
+ ->method('getStream')
+ ->willReturn($stream);
+ }
+
+ return $mock;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php b/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php
index e0aa9211..f5d891a1 100644
--- a/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php
+++ b/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php
@@ -11,9 +11,10 @@
namespace Symfony\Component\Console\Tests\Helper;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Helper\FormatterHelper;
-class FormatterHelperTest extends \PHPUnit_Framework_TestCase
+class FormatterHelperTest extends TestCase
{
public function testFormatSection()
{
@@ -89,4 +90,40 @@ class FormatterHelperTest extends \PHPUnit_Framework_TestCase
'::formatBlock() escapes \'<\' chars'
);
}
+
+ public function testTruncatingWithShorterLengthThanMessageWithSuffix()
+ {
+ $formatter = new FormatterHelper();
+ $message = 'testing truncate';
+
+ $this->assertSame('test...', $formatter->truncate($message, 4));
+ $this->assertSame('testing truncat...', $formatter->truncate($message, 15));
+ $this->assertSame('testing truncate...', $formatter->truncate($message, 16));
+ $this->assertSame('zażółć gęślą...', $formatter->truncate('zażółć gęślą jaźń', 12));
+ }
+
+ public function testTruncatingMessageWithCustomSuffix()
+ {
+ $formatter = new FormatterHelper();
+ $message = 'testing truncate';
+
+ $this->assertSame('test!', $formatter->truncate($message, 4, '!'));
+ }
+
+ public function testTruncatingWithLongerLengthThanMessageWithSuffix()
+ {
+ $formatter = new FormatterHelper();
+ $message = 'test';
+
+ $this->assertSame($message, $formatter->truncate($message, 10));
+ }
+
+ public function testTruncatingWithNegativeLength()
+ {
+ $formatter = new FormatterHelper();
+ $message = 'testing truncate';
+
+ $this->assertSame('testing tru...', $formatter->truncate($message, -5));
+ $this->assertSame('...', $formatter->truncate($message, -100));
+ }
}
diff --git a/vendor/symfony/console/Tests/Helper/HelperSetTest.php b/vendor/symfony/console/Tests/Helper/HelperSetTest.php
index 04edd304..aceef704 100644
--- a/vendor/symfony/console/Tests/Helper/HelperSetTest.php
+++ b/vendor/symfony/console/Tests/Helper/HelperSetTest.php
@@ -11,10 +11,11 @@
namespace Symfony\Component\Console\Tests\Helper;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Command\Command;
-class HelperSetTest extends \PHPUnit_Framework_TestCase
+class HelperSetTest extends TestCase
{
public function testConstructor()
{
@@ -108,16 +109,9 @@ class HelperSetTest extends \PHPUnit_Framework_TestCase
}
}
- /**
- * Create a generic mock for the helper interface. Optionally check for a call to setHelperSet with a specific
- * helperset instance.
- *
- * @param string $name
- * @param HelperSet $helperset allows a mock to verify a particular helperset set is being added to the Helper
- */
private function getGenericMockHelper($name, HelperSet $helperset = null)
{
- $mock_helper = $this->getMock('\Symfony\Component\Console\Helper\HelperInterface');
+ $mock_helper = $this->getMockBuilder('\Symfony\Component\Console\Helper\HelperInterface')->getMock();
$mock_helper->expects($this->any())
->method('getName')
->will($this->returnValue($name));
diff --git a/vendor/symfony/console/Tests/Helper/HelperTest.php b/vendor/symfony/console/Tests/Helper/HelperTest.php
index 33fa2205..18475824 100644
--- a/vendor/symfony/console/Tests/Helper/HelperTest.php
+++ b/vendor/symfony/console/Tests/Helper/HelperTest.php
@@ -11,9 +11,10 @@
namespace Symfony\Component\Console\Tests\Helper;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Helper\Helper;
-class HelperTest extends \PHPUnit_Framework_TestCase
+class HelperTest extends TestCase
{
public function formatTimeProvider()
{
diff --git a/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php b/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php
deleted file mode 100644
index 97bf7756..00000000
--- a/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php
+++ /dev/null
@@ -1,263 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Helper;
-
-use Symfony\Component\Console\Input\ArrayInput;
-use Symfony\Component\Console\Helper\DialogHelper;
-use Symfony\Component\Console\Helper\HelperSet;
-use Symfony\Component\Console\Helper\FormatterHelper;
-use Symfony\Component\Console\Output\ConsoleOutput;
-use Symfony\Component\Console\Output\StreamOutput;
-use Symfony\Component\Console\Exception\InvalidArgumentException;
-
-/**
- * @group legacy
- */
-class LegacyDialogHelperTest extends \PHPUnit_Framework_TestCase
-{
- public function testSelect()
- {
- $dialog = new DialogHelper();
-
- $helperSet = new HelperSet(array(new FormatterHelper()));
- $dialog->setHelperSet($helperSet);
-
- $heroes = array('Superman', 'Batman', 'Spiderman');
-
- $dialog->setInputStream($this->getInputStream("\n1\n 1 \nFabien\n1\nFabien\n1\n0,2\n 0 , 2 \n\n\n"));
- $this->assertEquals('2', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, '2'));
- $this->assertEquals('1', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes));
- $this->assertEquals('1', $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes));
- $this->assertEquals('1', $dialog->select($output = $this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', false));
-
- rewind($output->getStream());
- $this->assertContains('Input "Fabien" is not a superhero!', stream_get_contents($output->getStream()));
-
- try {
- $this->assertEquals('1', $dialog->select($output = $this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, 1));
- $this->fail();
- } catch (\InvalidArgumentException $e) {
- $this->assertEquals('Value "Fabien" is invalid', $e->getMessage());
- }
-
- $this->assertEquals(array('1'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', true));
- $this->assertEquals(array('0', '2'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', true));
- $this->assertEquals(array('0', '2'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', true));
- $this->assertEquals(array('0', '1'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, '0,1', false, 'Input "%s" is not a superhero!', true));
- $this->assertEquals(array('0', '1'), $dialog->select($this->getOutputStream(), 'What is your favorite superhero?', $heroes, ' 0 , 1 ', false, 'Input "%s" is not a superhero!', true));
- }
-
- public function testSelectOnErrorOutput()
- {
- $dialog = new DialogHelper();
-
- $helperSet = new HelperSet(array(new FormatterHelper()));
- $dialog->setHelperSet($helperSet);
-
- $heroes = array('Superman', 'Batman', 'Spiderman');
-
- $dialog->setInputStream($this->getInputStream("Stdout\n1\n"));
- $this->assertEquals('1', $dialog->select($output = $this->getConsoleOutput($this->getOutputStream()), 'What is your favorite superhero?', $heroes, null, false, 'Input "%s" is not a superhero!', false));
-
- rewind($output->getErrorOutput()->getStream());
- $this->assertContains('Input "Stdout" is not a superhero!', stream_get_contents($output->getErrorOutput()->getStream()));
- }
-
- public function testAsk()
- {
- $dialog = new DialogHelper();
-
- $dialog->setInputStream($this->getInputStream("\n8AM\n"));
-
- $this->assertEquals('2PM', $dialog->ask($this->getOutputStream(), 'What time is it?', '2PM'));
- $this->assertEquals('8AM', $dialog->ask($output = $this->getOutputStream(), 'What time is it?', '2PM'));
-
- rewind($output->getStream());
- $this->assertEquals('What time is it?', stream_get_contents($output->getStream()));
- }
-
- public function testAskOnErrorOutput()
- {
- if (!$this->hasSttyAvailable()) {
- $this->markTestSkipped('`stderr` is required to test stderr output functionality');
- }
-
- $dialog = new DialogHelper();
-
- $dialog->setInputStream($this->getInputStream("not stdout\n"));
-
- $this->assertEquals('not stdout', $dialog->ask($output = $this->getConsoleOutput($this->getOutputStream()), 'Where should output go?', 'stderr'));
-
- rewind($output->getErrorOutput()->getStream());
- $this->assertEquals('Where should output go?', stream_get_contents($output->getErrorOutput()->getStream()));
- }
-
- public function testAskWithAutocomplete()
- {
- if (!$this->hasSttyAvailable()) {
- $this->markTestSkipped('`stty` is required to test autocomplete functionality');
- }
-
- // Acm<NEWLINE>
- // Ac<BACKSPACE><BACKSPACE>s<TAB>Test<NEWLINE>
- // <NEWLINE>
- // <UP ARROW><UP ARROW><NEWLINE>
- // <UP ARROW><UP ARROW><UP ARROW><UP ARROW><UP ARROW><TAB>Test<NEWLINE>
- // <DOWN ARROW><NEWLINE>
- // S<BACKSPACE><BACKSPACE><DOWN ARROW><DOWN ARROW><NEWLINE>
- // F00<BACKSPACE><BACKSPACE>oo<TAB><NEWLINE>
- $inputStream = $this->getInputStream("Acm\nAc\177\177s\tTest\n\n\033[A\033[A\n\033[A\033[A\033[A\033[A\033[A\tTest\n\033[B\nS\177\177\033[B\033[B\nF00\177\177oo\t\n");
-
- $dialog = new DialogHelper();
- $dialog->setInputStream($inputStream);
-
- $bundles = array('AcmeDemoBundle', 'AsseticBundle', 'SecurityBundle', 'FooBundle');
-
- $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
- $this->assertEquals('AsseticBundleTest', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
- $this->assertEquals('FrameworkBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
- $this->assertEquals('SecurityBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
- $this->assertEquals('FooBundleTest', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
- $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
- $this->assertEquals('AsseticBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
- $this->assertEquals('FooBundle', $dialog->ask($this->getOutputStream(), 'Please select a bundle', 'FrameworkBundle', $bundles));
- }
-
- /**
- * @group tty
- */
- public function testAskHiddenResponse()
- {
- if ('\\' === DIRECTORY_SEPARATOR) {
- $this->markTestSkipped('This test is not supported on Windows');
- }
-
- $dialog = new DialogHelper();
-
- $dialog->setInputStream($this->getInputStream("8AM\n"));
-
- $this->assertEquals('8AM', $dialog->askHiddenResponse($this->getOutputStream(), 'What time is it?'));
- }
-
- /**
- * @group tty
- */
- public function testAskHiddenResponseOnErrorOutput()
- {
- if ('\\' === DIRECTORY_SEPARATOR) {
- $this->markTestSkipped('This test is not supported on Windows');
- }
-
- $dialog = new DialogHelper();
-
- $dialog->setInputStream($this->getInputStream("8AM\n"));
-
- $this->assertEquals('8AM', $dialog->askHiddenResponse($output = $this->getConsoleOutput($this->getOutputStream()), 'What time is it?'));
-
- rewind($output->getErrorOutput()->getStream());
- $this->assertContains('What time is it?', stream_get_contents($output->getErrorOutput()->getStream()));
- }
-
- public function testAskConfirmation()
- {
- $dialog = new DialogHelper();
-
- $dialog->setInputStream($this->getInputStream("\n\n"));
- $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?'));
- $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false));
-
- $dialog->setInputStream($this->getInputStream("y\nyes\n"));
- $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false));
- $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false));
-
- $dialog->setInputStream($this->getInputStream("n\nno\n"));
- $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', true));
- $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', true));
- }
-
- public function testAskAndValidate()
- {
- $dialog = new DialogHelper();
- $helperSet = new HelperSet(array(new FormatterHelper()));
- $dialog->setHelperSet($helperSet);
-
- $question = 'What color was the white horse of Henry IV?';
- $error = 'This is not a color!';
- $validator = function ($color) use ($error) {
- if (!in_array($color, array('white', 'black'))) {
- throw new InvalidArgumentException($error);
- }
-
- return $color;
- };
-
- $dialog->setInputStream($this->getInputStream("\nblack\n"));
- $this->assertEquals('white', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white'));
- $this->assertEquals('black', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white'));
-
- $dialog->setInputStream($this->getInputStream("green\nyellow\norange\n"));
- try {
- $this->assertEquals('white', $dialog->askAndValidate($output = $this->getConsoleOutput($this->getOutputStream()), $question, $validator, 2, 'white'));
- $this->fail();
- } catch (\InvalidArgumentException $e) {
- $this->assertEquals($error, $e->getMessage());
- rewind($output->getErrorOutput()->getStream());
- $this->assertContains('What color was the white horse of Henry IV?', stream_get_contents($output->getErrorOutput()->getStream()));
- }
- }
-
- public function testNoInteraction()
- {
- $dialog = new DialogHelper();
-
- $input = new ArrayInput(array());
- $input->setInteractive(false);
-
- $dialog->setInput($input);
-
- $this->assertEquals('not yet', $dialog->ask($this->getOutputStream(), 'Do you have a job?', 'not yet'));
- }
-
- protected function getInputStream($input)
- {
- $stream = fopen('php://memory', 'r+', false);
- fwrite($stream, $input);
- rewind($stream);
-
- return $stream;
- }
-
- protected function getOutputStream()
- {
- return new StreamOutput(fopen('php://memory', 'r+', false));
- }
-
- protected function getConsoleOutput($stderr)
- {
- $output = new ConsoleOutput();
- $output->setErrorOutput($stderr);
-
- return $output;
- }
-
- private function hasStderrSupport()
- {
- return false === $this->isRunningOS400();
- }
-
- private function hasSttyAvailable()
- {
- exec('stty 2>&1', $output, $exitcode);
-
- return $exitcode === 0;
- }
-}
diff --git a/vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php b/vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php
deleted file mode 100644
index f835a71e..00000000
--- a/vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php
+++ /dev/null
@@ -1,224 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Helper;
-
-use Symfony\Component\Console\Helper\ProgressHelper;
-use Symfony\Component\Console\Output\StreamOutput;
-
-/**
- * @group legacy
- * @group time-sensitive
- */
-class LegacyProgressHelperTest extends \PHPUnit_Framework_TestCase
-{
- public function testAdvance()
- {
- $progress = new ProgressHelper();
- $progress->start($output = $this->getOutputStream());
- $progress->advance();
-
- rewind($output->getStream());
- $this->assertEquals($this->generateOutput(' 1 [->--------------------------]'), stream_get_contents($output->getStream()));
- }
-
- public function testAdvanceWithStep()
- {
- $progress = new ProgressHelper();
- $progress->start($output = $this->getOutputStream());
- $progress->advance(5);
-
- rewind($output->getStream());
- $this->assertEquals($this->generateOutput(' 5 [----->----------------------]'), stream_get_contents($output->getStream()));
- }
-
- public function testAdvanceMultipleTimes()
- {
- $progress = new ProgressHelper();
- $progress->start($output = $this->getOutputStream());
- $progress->advance(3);
- $progress->advance(2);
-
- rewind($output->getStream());
- $this->assertEquals($this->generateOutput(' 3 [--->------------------------]').$this->generateOutput(' 5 [----->----------------------]'), stream_get_contents($output->getStream()));
- }
-
- public function testCustomizations()
- {
- $progress = new ProgressHelper();
- $progress->setBarWidth(10);
- $progress->setBarCharacter('_');
- $progress->setEmptyBarCharacter(' ');
- $progress->setProgressCharacter('/');
- $progress->setFormat(' %current%/%max% [%bar%] %percent%%');
- $progress->start($output = $this->getOutputStream(), 10);
- $progress->advance();
-
- rewind($output->getStream());
- $this->assertEquals($this->generateOutput(' 1/10 [_/ ] 10%'), stream_get_contents($output->getStream()));
- }
-
- public function testPercent()
- {
- $progress = new ProgressHelper();
- $progress->start($output = $this->getOutputStream(), 50);
- $progress->display();
- $progress->advance();
- $progress->advance();
-
- rewind($output->getStream());
- $this->assertEquals($this->generateOutput(' 0/50 [>---------------------------] 0%').$this->generateOutput(' 1/50 [>---------------------------] 2%').$this->generateOutput(' 2/50 [=>--------------------------] 4%'), stream_get_contents($output->getStream()));
- }
-
- public function testOverwriteWithShorterLine()
- {
- $progress = new ProgressHelper();
- $progress->setFormat(' %current%/%max% [%bar%] %percent%%');
- $progress->start($output = $this->getOutputStream(), 50);
- $progress->display();
- $progress->advance();
-
- // set shorter format
- $progress->setFormat(' %current%/%max% [%bar%]');
- $progress->advance();
-
- rewind($output->getStream());
- $this->assertEquals(
- $this->generateOutput(' 0/50 [>---------------------------] 0%').
- $this->generateOutput(' 1/50 [>---------------------------] 2%').
- $this->generateOutput(' 2/50 [=>--------------------------] '),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testSetCurrentProgress()
- {
- $progress = new ProgressHelper();
- $progress->start($output = $this->getOutputStream(), 50);
- $progress->display();
- $progress->advance();
- $progress->setCurrent(15);
- $progress->setCurrent(25);
-
- rewind($output->getStream());
- $this->assertEquals(
- $this->generateOutput(' 0/50 [>---------------------------] 0%').
- $this->generateOutput(' 1/50 [>---------------------------] 2%').
- $this->generateOutput(' 15/50 [========>-------------------] 30%').
- $this->generateOutput(' 25/50 [==============>-------------] 50%'),
- stream_get_contents($output->getStream())
- );
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage You must start the progress bar
- */
- public function testSetCurrentBeforeStarting()
- {
- $progress = new ProgressHelper();
- $progress->setCurrent(15);
- }
-
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage You can't regress the progress bar
- */
- public function testRegressProgress()
- {
- $progress = new ProgressHelper();
- $progress->start($output = $this->getOutputStream(), 50);
- $progress->setCurrent(15);
- $progress->setCurrent(10);
- }
-
- public function testRedrawFrequency()
- {
- $progress = $this->getMock('Symfony\Component\Console\Helper\ProgressHelper', array('display'));
- $progress->expects($this->exactly(4))
- ->method('display');
-
- $progress->setRedrawFrequency(2);
-
- $progress->start($output = $this->getOutputStream(), 6);
- $progress->setCurrent(1);
- $progress->advance(2);
- $progress->advance(2);
- $progress->advance(1);
- }
-
- public function testMultiByteSupport()
- {
- $progress = new ProgressHelper();
- $progress->start($output = $this->getOutputStream());
- $progress->setBarCharacter('■');
- $progress->advance(3);
-
- rewind($output->getStream());
- $this->assertEquals($this->generateOutput(' 3 [■■■>------------------------]'), stream_get_contents($output->getStream()));
- }
-
- public function testClear()
- {
- $progress = new ProgressHelper();
- $progress->start($output = $this->getOutputStream(), 50);
- $progress->setCurrent(25);
- $progress->clear();
-
- rewind($output->getStream());
- $this->assertEquals(
- $this->generateOutput(' 25/50 [==============>-------------] 50%').$this->generateOutput(''),
- stream_get_contents($output->getStream())
- );
- }
-
- public function testPercentNotHundredBeforeComplete()
- {
- $progress = new ProgressHelper();
- $progress->start($output = $this->getOutputStream(), 200);
- $progress->display();
- $progress->advance(199);
- $progress->advance();
-
- rewind($output->getStream());
- $this->assertEquals($this->generateOutput(' 0/200 [>---------------------------] 0%').$this->generateOutput(' 199/200 [===========================>] 99%').$this->generateOutput(' 200/200 [============================] 100%'), stream_get_contents($output->getStream()));
- }
-
- public function testNonDecoratedOutput()
- {
- $progress = new ProgressHelper();
- $progress->start($output = $this->getOutputStream(false));
- $progress->advance();
-
- rewind($output->getStream());
- $this->assertEquals('', stream_get_contents($output->getStream()));
- }
-
- protected function getOutputStream($decorated = true)
- {
- return new StreamOutput(fopen('php://memory', 'r+', false), StreamOutput::VERBOSITY_NORMAL, $decorated);
- }
-
- protected $lastMessagesLength;
-
- protected function generateOutput($expected)
- {
- $expectedout = $expected;
-
- if ($this->lastMessagesLength !== null) {
- $expectedout = str_pad($expected, $this->lastMessagesLength, "\x20", STR_PAD_RIGHT);
- }
-
- $this->lastMessagesLength = strlen($expectedout);
-
- return "\x0D".$expectedout;
- }
-}
diff --git a/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php b/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php
deleted file mode 100644
index 557dc14f..00000000
--- a/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php
+++ /dev/null
@@ -1,316 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Console\Tests\Helper;
-
-use Symfony\Component\Console\Helper\TableHelper;
-use Symfony\Component\Console\Output\StreamOutput;
-
-/**
- * @group legacy
- */
-class LegacyTableHelperTest extends \PHPUnit_Framework_TestCase
-{
- protected $stream;
-
- protected function setUp()
- {
- $this->stream = fopen('php://memory', 'r+');
- }
-
- protected function tearDown()
- {
- fclose($this->stream);
- $this->stream = null;
- }
-
- /**
- * @dataProvider testRenderProvider
- */
- public function testRender($headers, $rows, $layout, $expected)
- {
- $table = new TableHelper();
- $table
- ->setHeaders($headers)
- ->setRows($rows)
- ->setLayout($layout)
- ;
- $table->render($output = $this->getOutputStream());
-
- $this->assertEquals($expected, $this->getOutputContent($output));
- }
-
- /**
- * @dataProvider testRenderProvider
- */
- public function testRenderAddRows($headers, $rows, $layout, $expected)
- {
- $table = new TableHelper();
- $table
- ->setHeaders($headers)
- ->addRows($rows)
- ->setLayout($layout)
- ;
- $table->render($output = $this->getOutputStream());
-
- $this->assertEquals($expected, $this->getOutputContent($output));
- }
-
- /**
- * @dataProvider testRenderProvider
- */
- public function testRenderAddRowsOneByOne($headers, $rows, $layout, $expected)
- {
- $table = new TableHelper();
- $table
- ->setHeaders($headers)
- ->setLayout($layout)
- ;
- foreach ($rows as $row) {
- $table->addRow($row);
- }
- $table->render($output = $this->getOutputStream());
-
- $this->assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function testRenderProvider()
- {
- $books = array(
- array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
- array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'),
- array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
- array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
- );
-
- return array(
- array(
- array('ISBN', 'Title', 'Author'),
- $books,
- TableHelper::LAYOUT_DEFAULT,
-<<<'TABLE'
-+---------------+--------------------------+------------------+
-| ISBN | Title | Author |
-+---------------+--------------------------+------------------+
-| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
-| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
-| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
-| 80-902734-1-6 | And Then There Were None | Agatha Christie |
-+---------------+--------------------------+------------------+
-
-TABLE
- ),
- array(
- array('ISBN', 'Title', 'Author'),
- $books,
- TableHelper::LAYOUT_COMPACT,
-<<<TABLE
- ISBN Title Author
- 99921-58-10-7 Divine Comedy Dante Alighieri
- 9971-5-0210-0 A Tale of Two Cities Charles Dickens
- 960-425-059-0 The Lord of the Rings J. R. R. Tolkien
- 80-902734-1-6 And Then There Were None Agatha Christie
-
-TABLE
- ),
- array(
- array('ISBN', 'Title', 'Author'),
- $books,
- TableHelper::LAYOUT_BORDERLESS,
-<<<TABLE
- =============== ========================== ==================
- ISBN Title Author
- =============== ========================== ==================
- 99921-58-10-7 Divine Comedy Dante Alighieri
- 9971-5-0210-0 A Tale of Two Cities Charles Dickens
- 960-425-059-0 The Lord of the Rings J. R. R. Tolkien
- 80-902734-1-6 And Then There Were None Agatha Christie
- =============== ========================== ==================
-
-TABLE
- ),
- array(
- array('ISBN', 'Title'),
- array(
- array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
- array('9971-5-0210-0'),
- array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
- array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
- ),
- TableHelper::LAYOUT_DEFAULT,
-<<<'TABLE'
-+---------------+--------------------------+------------------+
-| ISBN | Title | |
-+---------------+--------------------------+------------------+
-| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
-| 9971-5-0210-0 | | |
-| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
-| 80-902734-1-6 | And Then There Were None | Agatha Christie |
-+---------------+--------------------------+------------------+
-
-TABLE
- ),
- array(
- array(),
- array(
- array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
- array('9971-5-0210-0'),
- array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'),
- array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
- ),
- TableHelper::LAYOUT_DEFAULT,
-<<<'TABLE'
-+---------------+--------------------------+------------------+
-| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
-| 9971-5-0210-0 | | |
-| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
-| 80-902734-1-6 | And Then There Were None | Agatha Christie |
-+---------------+--------------------------+------------------+
-
-TABLE
- ),
- array(
- array('ISBN', 'Title', 'Author'),
- array(
- array('99921-58-10-7', "Divine\nComedy", 'Dante Alighieri'),
- array('9971-5-0210-2', "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."),
- array('9971-5-0210-2', "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."),
- array('960-425-059-0', 'The Lord of the Rings', "J. R. R.\nTolkien"),
- ),
- TableHelper::LAYOUT_DEFAULT,
-<<<'TABLE'
-+---------------+----------------------------+-----------------+
-| ISBN | Title | Author |
-+---------------+----------------------------+-----------------+
-| 99921-58-10-7 | Divine | Dante Alighieri |
-| | Comedy | |
-| 9971-5-0210-2 | Harry Potter | Rowling |
-| | and the Chamber of Secrets | Joanne K. |
-| 9971-5-0210-2 | Harry Potter | Rowling |
-| | and the Chamber of Secrets | Joanne K. |
-| 960-425-059-0 | The Lord of the Rings | J. R. R. |
-| | | Tolkien |
-+---------------+----------------------------+-----------------+
-
-TABLE
- ),
- array(
- array('ISBN', 'Title'),
- array(),
- TableHelper::LAYOUT_DEFAULT,
-<<<'TABLE'
-+------+-------+
-| ISBN | Title |
-+------+-------+
-
-TABLE
- ),
- array(
- array(),
- array(),
- TableHelper::LAYOUT_DEFAULT,
- '',
- ),
- 'Cell text with tags used for Output styling' => array(
- array('ISBN', 'Title', 'Author'),
- array(
- array('<info>99921-58-10-7</info>', '<error>Divine Comedy</error>', '<fg=blue;bg=white>Dante Alighieri</fg=blue;bg=white>'),
- array('9971-5-0210-0', 'A Tale of Two Cities', '<info>Charles Dickens</>'),
- ),
- TableHelper::LAYOUT_DEFAULT,
-<<<'TABLE'
-+---------------+----------------------+-----------------+
-| ISBN | Title | Author |
-+---------------+----------------------+-----------------+
-| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
-| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
-+---------------+----------------------+-----------------+
-
-TABLE
- ),
- 'Cell text with tags not used for Output styling' => array(
- array('ISBN', 'Title', 'Author'),
- array(
- array('<strong>99921-58-10-700</strong>', '<f>Divine Com</f>', 'Dante Alighieri'),
- array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'),
- ),
- TableHelper::LAYOUT_DEFAULT,
-<<<'TABLE'
-+----------------------------------+----------------------+-----------------+
-| ISBN | Title | Author |
-+----------------------------------+----------------------+-----------------+
-| <strong>99921-58-10-700</strong> | <f>Divine Com</f> | Dante Alighieri |
-| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens |
-+----------------------------------+----------------------+-----------------+
-
-TABLE
- ),
- );
- }
-
- public function testRenderMultiByte()
- {
- $table = new TableHelper();
- $table
- ->setHeaders(array('■■'))
- ->setRows(array(array(1234)))
- ->setLayout(TableHelper::LAYOUT_DEFAULT)
- ;
- $table->render($output = $this->getOutputStream());
-
- $expected =
-<<<'TABLE'
-+------+
-| ■■ |
-+------+
-| 1234 |
-+------+
-
-TABLE;
-
- $this->assertEquals($expected, $this->getOutputContent($output));
- }
-
- public function testRenderFullWidthCharacters()
- {
- $table = new TableHelper();
- $table
- ->setHeaders(array('あいうえお'))
- ->setRows(array(array(1234567890)))
- ->setLayout(TableHelper::LAYOUT_DEFAULT)
- ;
- $table->render($output = $this->getOutputStream());
-
- $expected =
- <<<'TABLE'
-+------------+
-| あいうえお |
-+------------+
-| 1234567890 |
-+------------+
-
-TABLE;
-
- $this->assertEquals($expected, $this->getOutputContent($output));
- }
-
- protected function getOutputStream()
- {
- return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, false);
- }
-
- protected function getOutputContent(StreamOutput $output)
- {
- rewind($output->getStream());
-
- return str_replace(PHP_EOL, "\n", stream_get_contents($output->getStream()));
- }
-}
diff --git a/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php b/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php
index a51fb435..eb619539 100644
--- a/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php
+++ b/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php
@@ -11,13 +11,14 @@
namespace Symfony\Component\Console\Tests\Helper;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Helper\DebugFormatterHelper;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Output\StreamOutput;
use Symfony\Component\Console\Helper\ProcessHelper;
use Symfony\Component\Process\Process;
-class ProcessHelperTest extends \PHPUnit_Framework_TestCase
+class ProcessHelperTest extends TestCase
{
/**
* @dataProvider provideCommandsAndOutput
@@ -46,35 +47,35 @@ class ProcessHelperTest extends \PHPUnit_Framework_TestCase
public function provideCommandsAndOutput()
{
- $successOutputVerbose = <<<EOT
+ $successOutputVerbose = <<<'EOT'
RUN php -r "echo 42;"
RES Command ran successfully
EOT;
- $successOutputDebug = <<<EOT
+ $successOutputDebug = <<<'EOT'
RUN php -r "echo 42;"
OUT 42
RES Command ran successfully
EOT;
- $successOutputDebugWithTags = <<<EOT
+ $successOutputDebugWithTags = <<<'EOT'
RUN php -r "echo '<info>42</info>';"
OUT <info>42</info>
RES Command ran successfully
EOT;
- $successOutputProcessDebug = <<<EOT
+ $successOutputProcessDebug = <<<'EOT'
RUN 'php' '-r' 'echo 42;'
OUT 42
RES Command ran successfully
EOT;
- $syntaxErrorOutputVerbose = <<<EOT
+ $syntaxErrorOutputVerbose = <<<'EOT'
RUN php -r "fwrite(STDERR, 'error message');usleep(50000);fwrite(STDOUT, 'out message');exit(252);"
RES 252 Command did not run successfully
EOT;
- $syntaxErrorOutputDebug = <<<EOT
+ $syntaxErrorOutputDebug = <<<'EOT'
RUN php -r "fwrite(STDERR, 'error message');usleep(500000);fwrite(STDOUT, 'out message');exit(252);"
ERR error message
OUT out message
@@ -83,9 +84,9 @@ EOT;
EOT;
$errorMessage = 'An error occurred';
- if ('\\' === DIRECTORY_SEPARATOR) {
- $successOutputProcessDebug = str_replace("'", '"', $successOutputProcessDebug);
- }
+ $args = new Process(array('php', '-r', 'echo 42;'));
+ $args = $args->getCommandLine();
+ $successOutputProcessDebug = str_replace("'php' '-r' 'echo 42;'", $args, $successOutputProcessDebug);
return array(
array('', 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERBOSE, null),
diff --git a/vendor/symfony/console/Tests/Helper/ProgressBarTest.php b/vendor/symfony/console/Tests/Helper/ProgressBarTest.php
index 261908b5..aca64914 100644
--- a/vendor/symfony/console/Tests/Helper/ProgressBarTest.php
+++ b/vendor/symfony/console/Tests/Helper/ProgressBarTest.php
@@ -11,6 +11,7 @@
namespace Symfony\Component\Console\Tests\Helper;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Helper\Helper;
use Symfony\Component\Console\Output\StreamOutput;
@@ -18,7 +19,7 @@ use Symfony\Component\Console\Output\StreamOutput;
/**
* @group time-sensitive
*/
-class ProgressBarTest extends \PHPUnit_Framework_TestCase
+class ProgressBarTest extends TestCase
{
public function testMultipleStart()
{
@@ -29,7 +30,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0 [>---------------------------]').
+ ' 0 [>---------------------------]'.
$this->generateOutput(' 1 [->--------------------------]').
$this->generateOutput(' 0 [>---------------------------]'),
stream_get_contents($output->getStream())
@@ -44,7 +45,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0 [>---------------------------]').
+ ' 0 [>---------------------------]'.
$this->generateOutput(' 1 [->--------------------------]'),
stream_get_contents($output->getStream())
);
@@ -58,7 +59,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0 [>---------------------------]').
+ ' 0 [>---------------------------]'.
$this->generateOutput(' 5 [----->----------------------]'),
stream_get_contents($output->getStream())
);
@@ -73,7 +74,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0 [>---------------------------]').
+ ' 0 [>---------------------------]'.
$this->generateOutput(' 3 [--->------------------------]').
$this->generateOutput(' 5 [----->----------------------]'),
stream_get_contents($output->getStream())
@@ -89,17 +90,88 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 9/10 [=========================>--] 90%').
+ ' 9/10 [=========================>--] 90%'.
$this->generateOutput(' 10/10 [============================] 100%').
$this->generateOutput(' 11/11 [============================] 100%'),
stream_get_contents($output->getStream())
);
}
+ public function testRegress()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream());
+ $bar->start();
+ $bar->advance();
+ $bar->advance();
+ $bar->advance(-1);
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ ' 0 [>---------------------------]'.
+ $this->generateOutput(' 1 [->--------------------------]').
+ $this->generateOutput(' 2 [-->-------------------------]').
+ $this->generateOutput(' 1 [->--------------------------]'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testRegressWithStep()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream());
+ $bar->start();
+ $bar->advance(4);
+ $bar->advance(4);
+ $bar->advance(-2);
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ ' 0 [>---------------------------]'.
+ $this->generateOutput(' 4 [---->-----------------------]').
+ $this->generateOutput(' 8 [-------->-------------------]').
+ $this->generateOutput(' 6 [------>---------------------]'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testRegressMultipleTimes()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream());
+ $bar->start();
+ $bar->advance(3);
+ $bar->advance(3);
+ $bar->advance(-1);
+ $bar->advance(-2);
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ ' 0 [>---------------------------]'.
+ $this->generateOutput(' 3 [--->------------------------]').
+ $this->generateOutput(' 6 [------>---------------------]').
+ $this->generateOutput(' 5 [----->----------------------]').
+ $this->generateOutput(' 3 [--->------------------------]'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testRegressBelowMin()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(), 10);
+ $bar->setProgress(1);
+ $bar->advance(-1);
+ $bar->advance(-1);
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ ' 1/10 [==>-------------------------] 10%'.
+ $this->generateOutput(' 0/10 [>---------------------------] 0%'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
public function testFormat()
{
$expected =
- $this->generateOutput(' 0/10 [>---------------------------] 0%').
+ ' 0/10 [>---------------------------] 0%'.
$this->generateOutput(' 10/10 [============================] 100%').
$this->generateOutput(' 10/10 [============================] 100%')
;
@@ -156,7 +228,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0/10 [/ ] 0%').
+ ' 0/10 [/ ] 0%'.
$this->generateOutput(' 1/10 [_/ ] 10%'),
stream_get_contents($output->getStream())
);
@@ -169,7 +241,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0/50 [>---------------------------] 0%'),
+ ' 0/50 [>---------------------------] 0%',
stream_get_contents($output->getStream())
);
}
@@ -193,7 +265,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 50/50 [============================] 100%'),
+ ' 50/50 [============================] 100%',
stream_get_contents($output->getStream())
);
}
@@ -208,7 +280,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0/50 [>---------------------------] 0%').
+ ' 0/50 [>---------------------------] 0%'.
$this->generateOutput(' 0/50 [>---------------------------] 0%').
$this->generateOutput(' 1/50 [>---------------------------] 2%').
$this->generateOutput(' 2/50 [=>--------------------------] 4%'),
@@ -230,7 +302,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0/50 [>---------------------------] 0%').
+ ' 0/50 [>---------------------------] 0%'.
$this->generateOutput(' 0/50 [>---------------------------] 0%').
$this->generateOutput(' 1/50 [>---------------------------] 2%').
$this->generateOutput(' 2/50 [=>--------------------------]'),
@@ -247,7 +319,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0/50 [>---------------------------]').
+ ' 0/50 [>---------------------------]'.
$this->generateOutput(' 1/50 [>---------------------------]'),
stream_get_contents($output->getStream())
);
@@ -264,7 +336,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0/50 [>---------------------------] 0%').
+ ' 0/50 [>---------------------------] 0%'.
$this->generateOutput(' 0/50 [>---------------------------] 0%').
$this->generateOutput(' 1/50 [>---------------------------] 2%').
$this->generateOutput(' 15/50 [========>-------------------] 30%').
@@ -273,8 +345,6 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
);
}
- /**
- */
public function testSetCurrentBeforeStarting()
{
$bar = new ProgressBar($this->getOutputStream());
@@ -282,49 +352,54 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
$this->assertNotNull($bar->getStartTime());
}
- /**
- * @expectedException \LogicException
- * @expectedExceptionMessage You can't regress the progress bar
- */
- public function testRegressProgress()
- {
- $bar = new ProgressBar($output = $this->getOutputStream(), 50);
- $bar->start();
- $bar->setProgress(15);
- $bar->setProgress(10);
- }
-
public function testRedrawFrequency()
{
- $bar = $this->getMock('Symfony\Component\Console\Helper\ProgressBar', array('display'), array($this->getOutputStream(), 6));
- $bar->expects($this->exactly(4))->method('display');
-
+ $bar = new ProgressBar($output = $this->getOutputStream(), 6);
$bar->setRedrawFrequency(2);
$bar->start();
$bar->setProgress(1);
$bar->advance(2);
$bar->advance(2);
$bar->advance(1);
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ ' 0/6 [>---------------------------] 0%'.
+ $this->generateOutput(' 3/6 [==============>-------------] 50%').
+ $this->generateOutput(' 5/6 [=======================>----] 83%').
+ $this->generateOutput(' 6/6 [============================] 100%'),
+ stream_get_contents($output->getStream())
+ );
}
public function testRedrawFrequencyIsAtLeastOneIfZeroGiven()
{
- $bar = $this->getMock('Symfony\Component\Console\Helper\ProgressBar', array('display'), array($this->getOutputStream()));
-
- $bar->expects($this->exactly(2))->method('display');
+ $bar = new ProgressBar($output = $this->getOutputStream());
$bar->setRedrawFrequency(0);
$bar->start();
$bar->advance();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ ' 0 [>---------------------------]'.
+ $this->generateOutput(' 1 [->--------------------------]'),
+ stream_get_contents($output->getStream())
+ );
}
public function testRedrawFrequencyIsAtLeastOneIfSmallerOneGiven()
{
- $bar = $this->getMock('Symfony\Component\Console\Helper\ProgressBar', array('display'), array($this->getOutputStream()));
-
- $bar->expects($this->exactly(2))->method('display');
+ $bar = new ProgressBar($output = $this->getOutputStream());
$bar->setRedrawFrequency(0.9);
$bar->start();
$bar->advance();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ ' 0 [>---------------------------]'.
+ $this->generateOutput(' 1 [->--------------------------]'),
+ stream_get_contents($output->getStream())
+ );
}
public function testMultiByteSupport()
@@ -336,7 +411,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0 [>---------------------------]').
+ ' 0 [>---------------------------]'.
$this->generateOutput(' 3 [■■■>------------------------]'),
stream_get_contents($output->getStream())
);
@@ -351,7 +426,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0/50 [>---------------------------] 0%').
+ ' 0/50 [>---------------------------] 0%'.
$this->generateOutput(' 25/50 [==============>-------------] 50%').
$this->generateOutput(''),
stream_get_contents($output->getStream())
@@ -368,7 +443,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0/200 [>---------------------------] 0%').
+ ' 0/200 [>---------------------------] 0%'.
$this->generateOutput(' 0/200 [>---------------------------] 0%').
$this->generateOutput(' 199/200 [===========================>] 99%').
$this->generateOutput(' 200/200 [============================] 100%'),
@@ -468,9 +543,9 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0/2 [>---------------------------] 0%')."\n".
- $this->generateOutput(' 0/3 [#---------------------------] 0%')."\n".
- rtrim($this->generateOutput(' 0 [>---------------------------]')).
+ ' 0/2 [>---------------------------] 0%'."\n".
+ ' 0/3 [#---------------------------] 0%'."\n".
+ rtrim(' 0 [>---------------------------]').
"\033[2A".
$this->generateOutput(' 1/2 [==============>-------------] 50%')."\n".
@@ -508,7 +583,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- rtrim($this->generateOutput(' 0 [>---------------------------]')).
+ rtrim(' 0 [>---------------------------]').
rtrim($this->generateOutput(' 1 [->--------------------------]')).
rtrim($this->generateOutput(' 2 [-->-------------------------]')).
rtrim($this->generateOutput(' 3 [--->------------------------]')).
@@ -517,6 +592,24 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
);
}
+ public function testWithSmallScreen()
+ {
+ $output = $this->getOutputStream();
+
+ $bar = new ProgressBar($output);
+ putenv('COLUMNS=12');
+ $bar->start();
+ $bar->advance();
+ putenv('COLUMNS=120');
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ ' 0 [>---]'.
+ $this->generateOutput(' 1 [->--]'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
public function testAddingPlaceholderFormatter()
{
ProgressBar::setPlaceholderFormatterDefinition('remaining_steps', function (ProgressBar $bar) {
@@ -531,7 +624,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 3 [>---------------------------]').
+ ' 3 [>---------------------------]'.
$this->generateOutput(' 2 [=========>------------------]').
$this->generateOutput(' 0 [============================]'),
stream_get_contents($output->getStream())
@@ -550,7 +643,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(">---------------------------\nfoobar").
+ ">---------------------------\nfoobar".
$this->generateOutput("=========>------------------\nfoobar").
"\x0D\x1B[2K\x1B[1A\x1B[2K".
$this->generateOutput("============================\nfoobar"),
@@ -560,6 +653,8 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
public function testAnsiColorsAndEmojis()
{
+ putenv('COLUMNS=156');
+
$bar = new ProgressBar($output = $this->getOutputStream(), 15);
ProgressBar::setPlaceholderFormatterDefinition('memory', function (ProgressBar $bar) {
static $i = 0;
@@ -575,23 +670,37 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
$bar->setMessage('Starting the demo... fingers crossed', 'title');
$bar->start();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ " \033[44;37m Starting the demo... fingers crossed \033[0m\n".
+ ' 0/15 '.$progress.str_repeat($empty, 26)." 0%\n".
+ " \xf0\x9f\x8f\x81 < 1 sec \033[44;37m 0 B \033[0m",
+ stream_get_contents($output->getStream())
+ );
+ ftruncate($output->getStream(), 0);
+ rewind($output->getStream());
+
$bar->setMessage('Looks good to me...', 'title');
$bar->advance(4);
- $bar->setMessage('Thanks, bye', 'title');
- $bar->finish();
rewind($output->getStream());
$this->assertEquals(
$this->generateOutput(
- " \033[44;37m Starting the demo... fingers crossed \033[0m\n".
- ' 0/15 '.$progress.str_repeat($empty, 26)." 0%\n".
- " \xf0\x9f\x8f\x81 < 1 sec \033[44;37m 0 B \033[0m"
- ).
- $this->generateOutput(
" \033[44;37m Looks good to me... \033[0m\n".
' 4/15 '.str_repeat($done, 7).$progress.str_repeat($empty, 19)." 26%\n".
" \xf0\x9f\x8f\x81 < 1 sec \033[41;37m 97 KiB \033[0m"
- ).
+ ),
+ stream_get_contents($output->getStream())
+ );
+ ftruncate($output->getStream(), 0);
+ rewind($output->getStream());
+
+ $bar->setMessage('Thanks, bye', 'title');
+ $bar->finish();
+
+ rewind($output->getStream());
+ $this->assertEquals(
$this->generateOutput(
" \033[44;37m Thanks, bye \033[0m\n".
' 15/15 '.str_repeat($done, 28)." 100%\n".
@@ -599,6 +708,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
),
stream_get_contents($output->getStream())
);
+ putenv('COLUMNS=120');
}
public function testSetFormat()
@@ -608,7 +718,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
$bar->start();
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0 [>---------------------------]'),
+ ' 0 [>---------------------------]',
stream_get_contents($output->getStream())
);
@@ -617,7 +727,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
$bar->start();
rewind($output->getStream());
$this->assertEquals(
- $this->generateOutput(' 0/10 [>---------------------------] 0%'),
+ ' 0/10 [>---------------------------] 0%',
stream_get_contents($output->getStream())
);
}
@@ -661,4 +771,22 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
return "\x0D\x1B[2K".($count ? str_repeat("\x1B[1A\x1B[2K", $count) : '').$expected;
}
+
+ public function testBarWidthWithMultilineFormat()
+ {
+ putenv('COLUMNS=10');
+
+ $bar = new ProgressBar($output = $this->getOutputStream());
+ $bar->setFormat("%bar%\n0123456789");
+
+ // before starting
+ $bar->setBarWidth(5);
+ $this->assertEquals(5, $bar->getBarWidth());
+
+ // after starting
+ $bar->start();
+ rewind($output->getStream());
+ $this->assertEquals(5, $bar->getBarWidth(), stream_get_contents($output->getStream()));
+ putenv('COLUMNS=120');
+ }
}
diff --git a/vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php b/vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php
index 19262526..c85018de 100644
--- a/vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php
+++ b/vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php
@@ -2,13 +2,14 @@
namespace Symfony\Component\Console\Tests\Helper;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Helper\ProgressIndicator;
use Symfony\Component\Console\Output\StreamOutput;
/**
* @group time-sensitive
*/
-class ProgressIndicatorTest extends \PHPUnit_Framework_TestCase
+class ProgressIndicatorTest extends TestCase
{
public function testDefaultIndicator()
{
@@ -44,11 +45,11 @@ class ProgressIndicatorTest extends \PHPUnit_Framework_TestCase
$this->generateOutput(' \\ Starting...').
$this->generateOutput(' \\ Advancing...').
$this->generateOutput(' | Advancing...').
- $this->generateOutput(' | Done... ').
+ $this->generateOutput(' | Done...').
PHP_EOL.
$this->generateOutput(' - Starting Again...').
$this->generateOutput(' \\ Starting Again...').
- $this->generateOutput(' \\ Done Again... ').
+ $this->generateOutput(' \\ Done Again...').
PHP_EOL,
stream_get_contents($output->getStream())
);
@@ -70,8 +71,8 @@ class ProgressIndicatorTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(
' Starting...'.PHP_EOL.
- ' Midway... '.PHP_EOL.
- ' Done... '.PHP_EOL.PHP_EOL,
+ ' Midway...'.PHP_EOL.
+ ' Done...'.PHP_EOL.PHP_EOL,
stream_get_contents($output->getStream())
);
}
@@ -177,6 +178,6 @@ class ProgressIndicatorTest extends \PHPUnit_Framework_TestCase
{
$count = substr_count($expected, "\n");
- return "\x0D".($count ? sprintf("\033[%dA", $count) : '').$expected;
+ return "\x0D\x1B[2K".($count ? sprintf("\033[%dA", $count) : '').$expected;
}
}
diff --git a/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php b/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php
index 6a4f8ace..9a2887a2 100644
--- a/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php
+++ b/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php
@@ -23,7 +23,7 @@ use Symfony\Component\Console\Question\Question;
/**
* @group tty
*/
-class QuestionHelperTest extends \PHPUnit_Framework_TestCase
+class QuestionHelperTest extends AbstractQuestionHelperTest
{
public function testAskChoice()
{
@@ -34,22 +34,22 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
$heroes = array('Superman', 'Batman', 'Spiderman');
- $questionHelper->setInputStream($this->getInputStream("\n1\n 1 \nFabien\n1\nFabien\n1\n0,2\n 0 , 2 \n\n\n"));
+ $inputStream = $this->getInputStream("\n1\n 1 \nFabien\n1\nFabien\n1\n0,2\n 0 , 2 \n\n\n");
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '2');
$question->setMaxAttempts(1);
// first answer is an empty answer, we're supposed to receive the default value
- $this->assertEquals('Spiderman', $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('Spiderman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes);
$question->setMaxAttempts(1);
- $this->assertEquals('Batman', $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
- $this->assertEquals('Batman', $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('Batman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('Batman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes);
$question->setErrorMessage('Input "%s" is not a superhero!');
$question->setMaxAttempts(2);
- $this->assertEquals('Batman', $questionHelper->ask($this->createInputInterfaceMock(), $output = $this->createOutputInterface(), $question));
+ $this->assertEquals('Batman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question));
rewind($output->getStream());
$stream = stream_get_contents($output->getStream());
@@ -58,7 +58,7 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
try {
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '1');
$question->setMaxAttempts(1);
- $questionHelper->ask($this->createInputInterfaceMock(), $output = $this->createOutputInterface(), $question);
+ $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question);
$this->fail();
} catch (\InvalidArgumentException $e) {
$this->assertEquals('Value "Fabien" is invalid', $e->getMessage());
@@ -68,34 +68,34 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
$question->setMaxAttempts(1);
$question->setMultiselect(true);
- $this->assertEquals(array('Batman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
- $this->assertEquals(array('Superman', 'Spiderman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
- $this->assertEquals(array('Superman', 'Spiderman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals(array('Batman'), $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals(array('Superman', 'Spiderman'), $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals(array('Superman', 'Spiderman'), $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '0,1');
$question->setMaxAttempts(1);
$question->setMultiselect(true);
- $this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes, ' 0 , 1 ');
$question->setMaxAttempts(1);
$question->setMultiselect(true);
- $this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
}
public function testAsk()
{
$dialog = new QuestionHelper();
- $dialog->setInputStream($this->getInputStream("\n8AM\n"));
+ $inputStream = $this->getInputStream("\n8AM\n");
$question = new Question('What time is it?', '2PM');
- $this->assertEquals('2PM', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('2PM', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
$question = new Question('What time is it?', '2PM');
- $this->assertEquals('8AM', $dialog->ask($this->createInputInterfaceMock(), $output = $this->createOutputInterface(), $question));
+ $this->assertEquals('8AM', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question));
rewind($output->getStream());
$this->assertEquals('What time is it?', stream_get_contents($output->getStream()));
@@ -118,21 +118,20 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
$inputStream = $this->getInputStream("Acm\nAc\177\177s\tTest\n\n\033[A\033[A\n\033[A\033[A\033[A\033[A\033[A\tTest\n\033[B\nS\177\177\033[B\033[B\nF00\177\177oo\t\n");
$dialog = new QuestionHelper();
- $dialog->setInputStream($inputStream);
$helperSet = new HelperSet(array(new FormatterHelper()));
$dialog->setHelperSet($helperSet);
$question = new Question('Please select a bundle', 'FrameworkBundle');
$question->setAutocompleterValues(array('AcmeDemoBundle', 'AsseticBundle', 'SecurityBundle', 'FooBundle'));
- $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
- $this->assertEquals('AsseticBundleTest', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
- $this->assertEquals('FrameworkBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
- $this->assertEquals('SecurityBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
- $this->assertEquals('FooBundleTest', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
- $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
- $this->assertEquals('AsseticBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
- $this->assertEquals('FooBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('AsseticBundleTest', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('FrameworkBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('SecurityBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('FooBundleTest', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('AsseticBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('FooBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
}
public function testAskWithAutocompleteWithNonSequentialKeys()
@@ -145,14 +144,52 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
$inputStream = $this->getInputStream("\033[A\033[A\n\033[B\033[B\n");
$dialog = new QuestionHelper();
- $dialog->setInputStream($inputStream);
$dialog->setHelperSet(new HelperSet(array(new FormatterHelper())));
$question = new ChoiceQuestion('Please select a bundle', array(1 => 'AcmeDemoBundle', 4 => 'AsseticBundle'));
$question->setMaxAttempts(1);
- $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
- $this->assertEquals('AsseticBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('AsseticBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ }
+
+ public function testAutocompleteWithTrailingBackslash()
+ {
+ if (!$this->hasSttyAvailable()) {
+ $this->markTestSkipped('`stty` is required to test autocomplete functionality');
+ }
+
+ $inputStream = $this->getInputStream('E');
+
+ $dialog = new QuestionHelper();
+ $helperSet = new HelperSet(array(new FormatterHelper()));
+ $dialog->setHelperSet($helperSet);
+
+ $question = new Question('');
+ $expectedCompletion = 'ExampleNamespace\\';
+ $question->setAutocompleterValues(array($expectedCompletion));
+
+ $output = $this->createOutputInterface();
+ $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $output, $question);
+
+ $outputStream = $output->getStream();
+ rewind($outputStream);
+ $actualOutput = stream_get_contents($outputStream);
+
+ // Shell control (esc) sequences are not so important: we only care that
+ // <hl> tag is interpreted correctly and replaced
+ $irrelevantEscSequences = array(
+ "\0337" => '', // Save cursor position
+ "\0338" => '', // Restore cursor position
+ "\033[K" => '', // Clear line from cursor till the end
+ );
+
+ $importantActualOutput = strtr($actualOutput, $irrelevantEscSequences);
+
+ // Remove colors (e.g. "\033[30m", "\033[31;41m")
+ $importantActualOutput = preg_replace('/\033\[\d+(;\d+)?m/', '', $importantActualOutput);
+
+ $this->assertEquals($expectedCompletion, $importantActualOutput);
}
public function testAskHiddenResponse()
@@ -162,12 +199,11 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
}
$dialog = new QuestionHelper();
- $dialog->setInputStream($this->getInputStream("8AM\n"));
$question = new Question('What time is it?');
$question->setHidden(true);
- $this->assertEquals('8AM', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('8AM', $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream("8AM\n")), $this->createOutputInterface(), $question));
}
/**
@@ -177,9 +213,9 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
{
$dialog = new QuestionHelper();
- $dialog->setInputStream($this->getInputStream($question."\n"));
+ $inputStream = $this->getInputStream($question."\n");
$question = new ConfirmationQuestion('Do you like French fries?', $default);
- $this->assertEquals($expected, $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question), 'confirmation question should '.($expected ? 'pass' : 'cancel'));
+ $this->assertEquals($expected, $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question), 'confirmation question should '.($expected ? 'pass' : 'cancel'));
}
public function getAskConfirmationData()
@@ -198,11 +234,11 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
{
$dialog = new QuestionHelper();
- $dialog->setInputStream($this->getInputStream("j\ny\n"));
+ $inputStream = $this->getInputStream("j\ny\n");
$question = new ConfirmationQuestion('Do you like French fries?', false, '/^(j|y)/i');
- $this->assertTrue($dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertTrue($dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
$question = new ConfirmationQuestion('Do you like French fries?', false, '/^(j|y)/i');
- $this->assertTrue($dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertTrue($dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
}
public function testAskAndValidate()
@@ -224,13 +260,12 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
$question->setValidator($validator);
$question->setMaxAttempts(2);
- $dialog->setInputStream($this->getInputStream("\nblack\n"));
- $this->assertEquals('white', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
- $this->assertEquals('black', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $inputStream = $this->getInputStream("\nblack\n");
+ $this->assertEquals('white', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('black', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
- $dialog->setInputStream($this->getInputStream("green\nyellow\norange\n"));
try {
- $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question);
+ $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream("green\nyellow\norange\n")), $this->createOutputInterface(), $question);
$this->fail();
} catch (\InvalidArgumentException $e) {
$this->assertEquals($error, $e->getMessage());
@@ -249,13 +284,12 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
);
$dialog = new QuestionHelper();
- $dialog->setInputStream($this->getInputStream($providedAnswer."\n"));
$helperSet = new HelperSet(array(new FormatterHelper()));
$dialog->setHelperSet($helperSet);
$question = new ChoiceQuestion('Please select the environment to load', $possibleChoices);
$question->setMaxAttempts(1);
- $answer = $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question);
+ $answer = $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream($providedAnswer."\n")), $this->createOutputInterface(), $question);
$this->assertSame($expectedValue, $answer);
}
@@ -273,6 +307,37 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
}
/**
+ * @dataProvider specialCharacterInMultipleChoice
+ */
+ public function testSpecialCharacterChoiceFromMultipleChoiceList($providedAnswer, $expectedValue)
+ {
+ $possibleChoices = array(
+ '.',
+ 'src',
+ );
+
+ $dialog = new QuestionHelper();
+ $inputStream = $this->getInputStream($providedAnswer."\n");
+ $helperSet = new HelperSet(array(new FormatterHelper()));
+ $dialog->setHelperSet($helperSet);
+
+ $question = new ChoiceQuestion('Please select the directory', $possibleChoices);
+ $question->setMaxAttempts(1);
+ $question->setMultiselect(true);
+ $answer = $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question);
+
+ $this->assertSame($expectedValue, $answer);
+ }
+
+ public function specialCharacterInMultipleChoice()
+ {
+ return array(
+ array('.', array('.')),
+ array('., src', array('.', 'src')),
+ );
+ }
+
+ /**
* @dataProvider mixedKeysChoiceListAnswerProvider
*/
public function testChoiceFromChoicelistWithMixedKeys($providedAnswer, $expectedValue)
@@ -285,13 +350,12 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
);
$dialog = new QuestionHelper();
- $dialog->setInputStream($this->getInputStream($providedAnswer."\n"));
$helperSet = new HelperSet(array(new FormatterHelper()));
$dialog->setHelperSet($helperSet);
$question = new ChoiceQuestion('Please select the environment to load', $possibleChoices);
$question->setMaxAttempts(1);
- $answer = $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question);
+ $answer = $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream($providedAnswer."\n")), $this->createOutputInterface(), $question);
$this->assertSame($expectedValue, $answer);
}
@@ -320,13 +384,12 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
);
$dialog = new QuestionHelper();
- $dialog->setInputStream($this->getInputStream($providedAnswer."\n"));
$helperSet = new HelperSet(array(new FormatterHelper()));
$dialog->setHelperSet($helperSet);
$question = new ChoiceQuestion('Please select the environment to load', $possibleChoices);
$question->setMaxAttempts(1);
- $answer = $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question);
+ $answer = $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream($providedAnswer."\n")), $this->createOutputInterface(), $question);
$this->assertSame($expectedValue, $answer);
}
@@ -344,14 +407,13 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
);
$dialog = new QuestionHelper();
- $dialog->setInputStream($this->getInputStream("My environment\n"));
$helperSet = new HelperSet(array(new FormatterHelper()));
$dialog->setHelperSet($helperSet);
$question = new ChoiceQuestion('Please select the environment to load', $possibleChoices);
$question->setMaxAttempts(1);
- $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question);
+ $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream("My environment\n")), $this->createOutputInterface(), $question);
}
public function answerProvider()
@@ -368,7 +430,7 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
{
$dialog = new QuestionHelper();
$question = new Question('Do you have a job?', 'not yet');
- $this->assertEquals('not yet', $dialog->ask($this->createInputInterfaceMock(false), $this->createOutputInterface(), $question));
+ $this->assertEquals('not yet', $dialog->ask($this->createStreamableInputInterfaceMock(null, false), $this->createOutputInterface(), $question));
}
/**
@@ -388,7 +450,357 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
' [<info>żółw </info>] bar',
' [<info>łabądź</info>] baz',
);
- $output = $this->getMock('\Symfony\Component\Console\Output\OutputInterface');
+ $output = $this->getMockBuilder('\Symfony\Component\Console\Output\OutputInterface')->getMock();
+ $output->method('getFormatter')->willReturn(new OutputFormatter());
+
+ $dialog = new QuestionHelper();
+ $helperSet = new HelperSet(array(new FormatterHelper()));
+ $dialog->setHelperSet($helperSet);
+
+ $output->expects($this->once())->method('writeln')->with($this->equalTo($outputShown));
+
+ $question = new ChoiceQuestion($question, $possibleChoices, 'foo');
+ $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream("\n")), $output, $question);
+ }
+
+ /**
+ * @group legacy
+ */
+ public function testLegacyAskChoice()
+ {
+ $questionHelper = new QuestionHelper();
+
+ $helperSet = new HelperSet(array(new FormatterHelper()));
+ $questionHelper->setHelperSet($helperSet);
+
+ $heroes = array('Superman', 'Batman', 'Spiderman');
+
+ $questionHelper->setInputStream($this->getInputStream("\n1\n 1 \nFabien\n1\nFabien\n1\n0,2\n 0 , 2 \n\n\n"));
+
+ $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '2');
+ $question->setMaxAttempts(1);
+ // first answer is an empty answer, we're supposed to receive the default value
+ $this->assertEquals('Spiderman', $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+
+ $question = new ChoiceQuestion('What is your favorite superhero?', $heroes);
+ $question->setMaxAttempts(1);
+ $this->assertEquals('Batman', $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('Batman', $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+
+ $question = new ChoiceQuestion('What is your favorite superhero?', $heroes);
+ $question->setErrorMessage('Input "%s" is not a superhero!');
+ $question->setMaxAttempts(2);
+ $this->assertEquals('Batman', $questionHelper->ask($this->createInputInterfaceMock(), $output = $this->createOutputInterface(), $question));
+
+ rewind($output->getStream());
+ $stream = stream_get_contents($output->getStream());
+ $this->assertContains('Input "Fabien" is not a superhero!', $stream);
+
+ try {
+ $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '1');
+ $question->setMaxAttempts(1);
+ $questionHelper->ask($this->createInputInterfaceMock(), $output = $this->createOutputInterface(), $question);
+ $this->fail();
+ } catch (\InvalidArgumentException $e) {
+ $this->assertEquals('Value "Fabien" is invalid', $e->getMessage());
+ }
+
+ $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, null);
+ $question->setMaxAttempts(1);
+ $question->setMultiselect(true);
+
+ $this->assertEquals(array('Batman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals(array('Superman', 'Spiderman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals(array('Superman', 'Spiderman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+
+ $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '0,1');
+ $question->setMaxAttempts(1);
+ $question->setMultiselect(true);
+
+ $this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+
+ $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, ' 0 , 1 ');
+ $question->setMaxAttempts(1);
+ $question->setMultiselect(true);
+
+ $this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ }
+
+ /**
+ * @group legacy
+ */
+ public function testLegacyAsk()
+ {
+ $dialog = new QuestionHelper();
+
+ $dialog->setInputStream($this->getInputStream("\n8AM\n"));
+
+ $question = new Question('What time is it?', '2PM');
+ $this->assertEquals('2PM', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+
+ $question = new Question('What time is it?', '2PM');
+ $this->assertEquals('8AM', $dialog->ask($this->createInputInterfaceMock(), $output = $this->createOutputInterface(), $question));
+
+ rewind($output->getStream());
+ $this->assertEquals('What time is it?', stream_get_contents($output->getStream()));
+ }
+
+ /**
+ * @group legacy
+ */
+ public function testLegacyAskWithAutocomplete()
+ {
+ if (!$this->hasSttyAvailable()) {
+ $this->markTestSkipped('`stty` is required to test autocomplete functionality');
+ }
+
+ // Acm<NEWLINE>
+ // Ac<BACKSPACE><BACKSPACE>s<TAB>Test<NEWLINE>
+ // <NEWLINE>
+ // <UP ARROW><UP ARROW><NEWLINE>
+ // <UP ARROW><UP ARROW><UP ARROW><UP ARROW><UP ARROW><TAB>Test<NEWLINE>
+ // <DOWN ARROW><NEWLINE>
+ // S<BACKSPACE><BACKSPACE><DOWN ARROW><DOWN ARROW><NEWLINE>
+ // F00<BACKSPACE><BACKSPACE>oo<TAB><NEWLINE>
+ $inputStream = $this->getInputStream("Acm\nAc\177\177s\tTest\n\n\033[A\033[A\n\033[A\033[A\033[A\033[A\033[A\tTest\n\033[B\nS\177\177\033[B\033[B\nF00\177\177oo\t\n");
+
+ $dialog = new QuestionHelper();
+ $dialog->setInputStream($inputStream);
+ $helperSet = new HelperSet(array(new FormatterHelper()));
+ $dialog->setHelperSet($helperSet);
+
+ $question = new Question('Please select a bundle', 'FrameworkBundle');
+ $question->setAutocompleterValues(array('AcmeDemoBundle', 'AsseticBundle', 'SecurityBundle', 'FooBundle'));
+
+ $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('AsseticBundleTest', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('FrameworkBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('SecurityBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('FooBundleTest', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('AsseticBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('FooBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ }
+
+ /**
+ * @group legacy
+ */
+ public function testLegacyAskWithAutocompleteWithNonSequentialKeys()
+ {
+ if (!$this->hasSttyAvailable()) {
+ $this->markTestSkipped('`stty` is required to test autocomplete functionality');
+ }
+
+ // <UP ARROW><UP ARROW><NEWLINE><DOWN ARROW><DOWN ARROW><NEWLINE>
+ $inputStream = $this->getInputStream("\033[A\033[A\n\033[B\033[B\n");
+
+ $dialog = new QuestionHelper();
+ $dialog->setInputStream($inputStream);
+ $dialog->setHelperSet(new HelperSet(array(new FormatterHelper())));
+
+ $question = new ChoiceQuestion('Please select a bundle', array(1 => 'AcmeDemoBundle', 4 => 'AsseticBundle'));
+ $question->setMaxAttempts(1);
+
+ $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('AsseticBundle', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ }
+
+ /**
+ * @group legacy
+ */
+ public function testLegacyAskHiddenResponse()
+ {
+ if ('\\' === DIRECTORY_SEPARATOR) {
+ $this->markTestSkipped('This test is not supported on Windows');
+ }
+
+ $dialog = new QuestionHelper();
+ $dialog->setInputStream($this->getInputStream("8AM\n"));
+
+ $question = new Question('What time is it?');
+ $question->setHidden(true);
+
+ $this->assertEquals('8AM', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ }
+
+ /**
+ * @group legacy
+ * @dataProvider getAskConfirmationData
+ */
+ public function testLegacyAskConfirmation($question, $expected, $default = true)
+ {
+ $dialog = new QuestionHelper();
+
+ $dialog->setInputStream($this->getInputStream($question."\n"));
+ $question = new ConfirmationQuestion('Do you like French fries?', $default);
+ $this->assertEquals($expected, $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question), 'confirmation question should '.($expected ? 'pass' : 'cancel'));
+ }
+
+ /**
+ * @group legacy
+ */
+ public function testLegacyAskConfirmationWithCustomTrueAnswer()
+ {
+ $dialog = new QuestionHelper();
+
+ $dialog->setInputStream($this->getInputStream("j\ny\n"));
+ $question = new ConfirmationQuestion('Do you like French fries?', false, '/^(j|y)/i');
+ $this->assertTrue($dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $question = new ConfirmationQuestion('Do you like French fries?', false, '/^(j|y)/i');
+ $this->assertTrue($dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ }
+
+ /**
+ * @group legacy
+ */
+ public function testLegacyAskAndValidate()
+ {
+ $dialog = new QuestionHelper();
+ $helperSet = new HelperSet(array(new FormatterHelper()));
+ $dialog->setHelperSet($helperSet);
+
+ $error = 'This is not a color!';
+ $validator = function ($color) use ($error) {
+ if (!in_array($color, array('white', 'black'))) {
+ throw new \InvalidArgumentException($error);
+ }
+
+ return $color;
+ };
+
+ $question = new Question('What color was the white horse of Henry IV?', 'white');
+ $question->setValidator($validator);
+ $question->setMaxAttempts(2);
+
+ $dialog->setInputStream($this->getInputStream("\nblack\n"));
+ $this->assertEquals('white', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->assertEquals('black', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+
+ $dialog->setInputStream($this->getInputStream("green\nyellow\norange\n"));
+ try {
+ $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question);
+ $this->fail();
+ } catch (\InvalidArgumentException $e) {
+ $this->assertEquals($error, $e->getMessage());
+ }
+ }
+
+ /**
+ * @group legacy
+ * @dataProvider simpleAnswerProvider
+ */
+ public function testLegacySelectChoiceFromSimpleChoices($providedAnswer, $expectedValue)
+ {
+ $possibleChoices = array(
+ 'My environment 1',
+ 'My environment 2',
+ 'My environment 3',
+ );
+
+ $dialog = new QuestionHelper();
+ $dialog->setInputStream($this->getInputStream($providedAnswer."\n"));
+ $helperSet = new HelperSet(array(new FormatterHelper()));
+ $dialog->setHelperSet($helperSet);
+
+ $question = new ChoiceQuestion('Please select the environment to load', $possibleChoices);
+ $question->setMaxAttempts(1);
+ $answer = $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question);
+
+ $this->assertSame($expectedValue, $answer);
+ }
+
+ /**
+ * @group legacy
+ * @dataProvider mixedKeysChoiceListAnswerProvider
+ */
+ public function testLegacyChoiceFromChoicelistWithMixedKeys($providedAnswer, $expectedValue)
+ {
+ $possibleChoices = array(
+ '0' => 'No environment',
+ '1' => 'My environment 1',
+ 'env_2' => 'My environment 2',
+ 3 => 'My environment 3',
+ );
+
+ $dialog = new QuestionHelper();
+ $dialog->setInputStream($this->getInputStream($providedAnswer."\n"));
+ $helperSet = new HelperSet(array(new FormatterHelper()));
+ $dialog->setHelperSet($helperSet);
+
+ $question = new ChoiceQuestion('Please select the environment to load', $possibleChoices);
+ $question->setMaxAttempts(1);
+ $answer = $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question);
+
+ $this->assertSame($expectedValue, $answer);
+ }
+
+ /**
+ * @group legacy
+ * @dataProvider answerProvider
+ */
+ public function testLegacySelectChoiceFromChoiceList($providedAnswer, $expectedValue)
+ {
+ $possibleChoices = array(
+ 'env_1' => 'My environment 1',
+ 'env_2' => 'My environment',
+ 'env_3' => 'My environment',
+ );
+
+ $dialog = new QuestionHelper();
+ $dialog->setInputStream($this->getInputStream($providedAnswer."\n"));
+ $helperSet = new HelperSet(array(new FormatterHelper()));
+ $dialog->setHelperSet($helperSet);
+
+ $question = new ChoiceQuestion('Please select the environment to load', $possibleChoices);
+ $question->setMaxAttempts(1);
+ $answer = $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question);
+
+ $this->assertSame($expectedValue, $answer);
+ }
+
+ /**
+ * @group legacy
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The provided answer is ambiguous. Value should be one of env_2 or env_3.
+ */
+ public function testLegacyAmbiguousChoiceFromChoicelist()
+ {
+ $possibleChoices = array(
+ 'env_1' => 'My first environment',
+ 'env_2' => 'My environment',
+ 'env_3' => 'My environment',
+ );
+
+ $dialog = new QuestionHelper();
+ $dialog->setInputStream($this->getInputStream("My environment\n"));
+ $helperSet = new HelperSet(array(new FormatterHelper()));
+ $dialog->setHelperSet($helperSet);
+
+ $question = new ChoiceQuestion('Please select the environment to load', $possibleChoices);
+ $question->setMaxAttempts(1);
+
+ $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question);
+ }
+
+ /**
+ * @requires function mb_strwidth
+ * @group legacy
+ */
+ public function testLegacyChoiceOutputFormattingQuestionForUtf8Keys()
+ {
+ $question = 'Lorem ipsum?';
+ $possibleChoices = array(
+ 'foo' => 'foo',
+ 'żółw' => 'bar',
+ 'łabądź' => 'baz',
+ );
+ $outputShown = array(
+ $question,
+ ' [<info>foo </info>] foo',
+ ' [<info>żółw </info>] bar',
+ ' [<info>łabądź</info>] baz',
+ );
+ $output = $this->getMockBuilder('\Symfony\Component\Console\Output\OutputInterface')->getMock();
$output->method('getFormatter')->willReturn(new OutputFormatter());
$dialog = new QuestionHelper();
@@ -402,6 +814,76 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
$dialog->ask($this->createInputInterfaceMock(), $output, $question);
}
+ /**
+ * @expectedException \Symfony\Component\Console\Exception\RuntimeException
+ * @expectedExceptionMessage Aborted
+ */
+ public function testAskThrowsExceptionOnMissingInput()
+ {
+ $dialog = new QuestionHelper();
+ $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream('')), $this->createOutputInterface(), new Question('What\'s your name?'));
+ }
+
+ /**
+ * @expectedException \Symfony\Component\Console\Exception\RuntimeException
+ * @expectedExceptionMessage Aborted
+ */
+ public function testAskThrowsExceptionOnMissingInputWithValidator()
+ {
+ $dialog = new QuestionHelper();
+
+ $question = new Question('What\'s your name?');
+ $question->setValidator(function () {
+ if (!$value) {
+ throw new \Exception('A value is required.');
+ }
+ });
+
+ $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream('')), $this->createOutputInterface(), $question);
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage Choice question must have at least 1 choice available.
+ */
+ public function testEmptyChoices()
+ {
+ new ChoiceQuestion('Question', array(), 'irrelevant');
+ }
+
+ public function testTraversableAutocomplete()
+ {
+ if (!$this->hasSttyAvailable()) {
+ $this->markTestSkipped('`stty` is required to test autocomplete functionality');
+ }
+
+ // Acm<NEWLINE>
+ // Ac<BACKSPACE><BACKSPACE>s<TAB>Test<NEWLINE>
+ // <NEWLINE>
+ // <UP ARROW><UP ARROW><NEWLINE>
+ // <UP ARROW><UP ARROW><UP ARROW><UP ARROW><UP ARROW><TAB>Test<NEWLINE>
+ // <DOWN ARROW><NEWLINE>
+ // S<BACKSPACE><BACKSPACE><DOWN ARROW><DOWN ARROW><NEWLINE>
+ // F00<BACKSPACE><BACKSPACE>oo<TAB><NEWLINE>
+ $inputStream = $this->getInputStream("Acm\nAc\177\177s\tTest\n\n\033[A\033[A\n\033[A\033[A\033[A\033[A\033[A\tTest\n\033[B\nS\177\177\033[B\033[B\nF00\177\177oo\t\n");
+
+ $dialog = new QuestionHelper();
+ $helperSet = new HelperSet(array(new FormatterHelper()));
+ $dialog->setHelperSet($helperSet);
+
+ $question = new Question('Please select a bundle', 'FrameworkBundle');
+ $question->setAutocompleterValues(new AutocompleteValues(array('irrelevant' => 'AcmeDemoBundle', 'AsseticBundle', 'SecurityBundle', 'FooBundle')));
+
+ $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('AsseticBundleTest', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('FrameworkBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('SecurityBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('FooBundleTest', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('AcmeDemoBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('AsseticBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('FooBundle', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ }
+
protected function getInputStream($input)
{
$stream = fopen('php://memory', 'r+', false);
@@ -418,7 +900,7 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
protected function createInputInterfaceMock($interactive = true)
{
- $mock = $this->getMock('Symfony\Component\Console\Input\InputInterface');
+ $mock = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock();
$mock->expects($this->any())
->method('isInteractive')
->will($this->returnValue($interactive));
@@ -430,6 +912,21 @@ class QuestionHelperTest extends \PHPUnit_Framework_TestCase
{
exec('stty 2>&1', $output, $exitcode);
- return $exitcode === 0;
+ return 0 === $exitcode;
+ }
+}
+
+class AutocompleteValues implements \IteratorAggregate
+{
+ private $values;
+
+ public function __construct(array $values)
+ {
+ $this->values = $values;
+ }
+
+ public function getIterator()
+ {
+ return new \ArrayIterator($this->values);
}
}
diff --git a/vendor/symfony/console/Tests/Helper/SymfonyQuestionHelperTest.php b/vendor/symfony/console/Tests/Helper/SymfonyQuestionHelperTest.php
new file mode 100644
index 00000000..ce946e5b
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/SymfonyQuestionHelperTest.php
@@ -0,0 +1,156 @@
+<?php
+
+namespace Symfony\Component\Console\Tests\Helper;
+
+use Symfony\Component\Console\Helper\FormatterHelper;
+use Symfony\Component\Console\Helper\HelperSet;
+use Symfony\Component\Console\Helper\SymfonyQuestionHelper;
+use Symfony\Component\Console\Output\StreamOutput;
+use Symfony\Component\Console\Question\Question;
+use Symfony\Component\Console\Question\ChoiceQuestion;
+
+/**
+ * @group tty
+ */
+class SymfonyQuestionHelperTest extends AbstractQuestionHelperTest
+{
+ public function testAskChoice()
+ {
+ $questionHelper = new SymfonyQuestionHelper();
+
+ $helperSet = new HelperSet(array(new FormatterHelper()));
+ $questionHelper->setHelperSet($helperSet);
+
+ $heroes = array('Superman', 'Batman', 'Spiderman');
+
+ $inputStream = $this->getInputStream("\n1\n 1 \nFabien\n1\nFabien\n1\n0,2\n 0 , 2 \n\n\n");
+
+ $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '2');
+ $question->setMaxAttempts(1);
+ // first answer is an empty answer, we're supposed to receive the default value
+ $this->assertEquals('Spiderman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question));
+ $this->assertOutputContains('What is your favorite superhero? [Spiderman]', $output);
+
+ $question = new ChoiceQuestion('What is your favorite superhero?', $heroes);
+ $question->setMaxAttempts(1);
+ $this->assertEquals('Batman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals('Batman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+
+ $question = new ChoiceQuestion('What is your favorite superhero?', $heroes);
+ $question->setErrorMessage('Input "%s" is not a superhero!');
+ $question->setMaxAttempts(2);
+ $this->assertEquals('Batman', $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question));
+ $this->assertOutputContains('Input "Fabien" is not a superhero!', $output);
+
+ try {
+ $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '1');
+ $question->setMaxAttempts(1);
+ $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question);
+ $this->fail();
+ } catch (\InvalidArgumentException $e) {
+ $this->assertEquals('Value "Fabien" is invalid', $e->getMessage());
+ }
+
+ $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, null);
+ $question->setMaxAttempts(1);
+ $question->setMultiselect(true);
+
+ $this->assertEquals(array('Batman'), $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals(array('Superman', 'Spiderman'), $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+ $this->assertEquals(array('Superman', 'Spiderman'), $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $this->createOutputInterface(), $question));
+
+ $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, '0,1');
+ $question->setMaxAttempts(1);
+ $question->setMultiselect(true);
+
+ $this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question));
+ $this->assertOutputContains('What is your favorite superhero? [Superman, Batman]', $output);
+
+ $question = new ChoiceQuestion('What is your favorite superhero?', $heroes, ' 0 , 1 ');
+ $question->setMaxAttempts(1);
+ $question->setMultiselect(true);
+
+ $this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createStreamableInputInterfaceMock($inputStream), $output = $this->createOutputInterface(), $question));
+ $this->assertOutputContains('What is your favorite superhero? [Superman, Batman]', $output);
+ }
+
+ public function testAskReturnsNullIfValidatorAllowsIt()
+ {
+ $questionHelper = new SymfonyQuestionHelper();
+ $question = new Question('What is your favorite superhero?');
+ $question->setValidator(function ($value) { return $value; });
+ $input = $this->createStreamableInputInterfaceMock($this->getInputStream("\n"));
+ $this->assertNull($questionHelper->ask($input, $this->createOutputInterface(), $question));
+ }
+
+ public function testAskEscapeDefaultValue()
+ {
+ $helper = new SymfonyQuestionHelper();
+ $input = $this->createStreamableInputInterfaceMock($this->getInputStream('\\'));
+ $helper->ask($input, $output = $this->createOutputInterface(), new Question('Can I have a backslash?', '\\'));
+
+ $this->assertOutputContains('Can I have a backslash? [\]', $output);
+ }
+
+ public function testAskEscapeAndFormatLabel()
+ {
+ $helper = new SymfonyQuestionHelper();
+ $input = $this->createStreamableInputInterfaceMock($this->getInputStream('Foo\\Bar'));
+ $helper->ask($input, $output = $this->createOutputInterface(), new Question('Do you want to use Foo\\Bar <comment>or</comment> Foo\\Baz\\?', 'Foo\\Baz'));
+
+ $this->assertOutputContains('Do you want to use Foo\\Bar or Foo\\Baz\\? [Foo\\Baz]:', $output);
+ }
+
+ public function testLabelTrailingBackslash()
+ {
+ $helper = new SymfonyQuestionHelper();
+ $input = $this->createStreamableInputInterfaceMock($this->getInputStream('sure'));
+ $helper->ask($input, $output = $this->createOutputInterface(), new Question('Question with a trailing \\'));
+
+ $this->assertOutputContains('Question with a trailing \\', $output);
+ }
+
+ /**
+ * @expectedException \Symfony\Component\Console\Exception\RuntimeException
+ * @expectedExceptionMessage Aborted
+ */
+ public function testAskThrowsExceptionOnMissingInput()
+ {
+ $dialog = new SymfonyQuestionHelper();
+ $dialog->ask($this->createStreamableInputInterfaceMock($this->getInputStream('')), $this->createOutputInterface(), new Question('What\'s your name?'));
+ }
+
+ protected function getInputStream($input)
+ {
+ $stream = fopen('php://memory', 'r+', false);
+ fwrite($stream, $input);
+ rewind($stream);
+
+ return $stream;
+ }
+
+ protected function createOutputInterface()
+ {
+ $output = new StreamOutput(fopen('php://memory', 'r+', false));
+ $output->setDecorated(false);
+
+ return $output;
+ }
+
+ protected function createInputInterfaceMock($interactive = true)
+ {
+ $mock = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock();
+ $mock->expects($this->any())
+ ->method('isInteractive')
+ ->will($this->returnValue($interactive));
+
+ return $mock;
+ }
+
+ private function assertOutputContains($expected, StreamOutput $output)
+ {
+ rewind($output->getStream());
+ $stream = stream_get_contents($output->getStream());
+ $this->assertContains($expected, $stream);
+ }
+}
diff --git a/vendor/symfony/console/Tests/Helper/TableStyleTest.php b/vendor/symfony/console/Tests/Helper/TableStyleTest.php
index 587d8414..13e918b3 100644
--- a/vendor/symfony/console/Tests/Helper/TableStyleTest.php
+++ b/vendor/symfony/console/Tests/Helper/TableStyleTest.php
@@ -11,9 +11,10 @@
namespace Symfony\Component\Console\Tests\Helper;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Helper\TableStyle;
-class TableStyleTest extends \PHPUnit_Framework_TestCase
+class TableStyleTest extends TestCase
{
/**
* @expectedException \InvalidArgumentException
diff --git a/vendor/symfony/console/Tests/Helper/TableTest.php b/vendor/symfony/console/Tests/Helper/TableTest.php
index 9ecb381a..d8a8ff00 100644
--- a/vendor/symfony/console/Tests/Helper/TableTest.php
+++ b/vendor/symfony/console/Tests/Helper/TableTest.php
@@ -11,13 +11,14 @@
namespace Symfony\Component\Console\Tests\Helper;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableStyle;
use Symfony\Component\Console\Helper\TableSeparator;
use Symfony\Component\Console\Helper\TableCell;
use Symfony\Component\Console\Output\StreamOutput;
-class TableTest extends \PHPUnit_Framework_TestCase
+class TableTest extends TestCase
{
protected $stream;
@@ -33,11 +34,11 @@ class TableTest extends \PHPUnit_Framework_TestCase
}
/**
- * @dataProvider testRenderProvider
+ * @dataProvider renderProvider
*/
- public function testRender($headers, $rows, $style, $expected)
+ public function testRender($headers, $rows, $style, $expected, $decorated = false)
{
- $table = new Table($output = $this->getOutputStream());
+ $table = new Table($output = $this->getOutputStream($decorated));
$table
->setHeaders($headers)
->setRows($rows)
@@ -49,11 +50,11 @@ class TableTest extends \PHPUnit_Framework_TestCase
}
/**
- * @dataProvider testRenderProvider
+ * @dataProvider renderProvider
*/
- public function testRenderAddRows($headers, $rows, $style, $expected)
+ public function testRenderAddRows($headers, $rows, $style, $expected, $decorated = false)
{
- $table = new Table($output = $this->getOutputStream());
+ $table = new Table($output = $this->getOutputStream($decorated));
$table
->setHeaders($headers)
->addRows($rows)
@@ -65,11 +66,11 @@ class TableTest extends \PHPUnit_Framework_TestCase
}
/**
- * @dataProvider testRenderProvider
+ * @dataProvider renderProvider
*/
- public function testRenderAddRowsOneByOne($headers, $rows, $style, $expected)
+ public function testRenderAddRowsOneByOne($headers, $rows, $style, $expected, $decorated = false)
{
- $table = new Table($output = $this->getOutputStream());
+ $table = new Table($output = $this->getOutputStream($decorated));
$table
->setHeaders($headers)
->setStyle($style)
@@ -82,7 +83,7 @@ class TableTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($expected, $this->getOutputContent($output));
}
- public function testRenderProvider()
+ public function renderProvider()
{
$books = array(
array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
@@ -96,7 +97,7 @@ class TableTest extends \PHPUnit_Framework_TestCase
array('ISBN', 'Title', 'Author'),
$books,
'default',
-<<<TABLE
+<<<'TABLE'
+---------------+--------------------------+------------------+
| ISBN | Title | Author |
+---------------+--------------------------+------------------+
@@ -112,7 +113,7 @@ TABLE
array('ISBN', 'Title', 'Author'),
$books,
'compact',
-<<<TABLE
+<<<'TABLE'
ISBN Title Author
99921-58-10-7 Divine Comedy Dante Alighieri
9971-5-0210-0 A Tale of Two Cities Charles Dickens
@@ -125,7 +126,7 @@ TABLE
array('ISBN', 'Title', 'Author'),
$books,
'borderless',
-<<<TABLE
+<<<'TABLE'
=============== ========================== ==================
ISBN Title Author
=============== ========================== ==================
@@ -146,7 +147,7 @@ TABLE
array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
),
'default',
-<<<TABLE
+<<<'TABLE'
+---------------+--------------------------+------------------+
| ISBN | Title | |
+---------------+--------------------------+------------------+
@@ -167,7 +168,7 @@ TABLE
array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'),
),
'default',
-<<<TABLE
+<<<'TABLE'
+---------------+--------------------------+------------------+
| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
| 9971-5-0210-0 | | |
@@ -186,7 +187,7 @@ TABLE
array('960-425-059-0', 'The Lord of the Rings', "J. R. R.\nTolkien"),
),
'default',
-<<<TABLE
+<<<'TABLE'
+---------------+----------------------------+-----------------+
| ISBN | Title | Author |
+---------------+----------------------------+-----------------+
@@ -206,7 +207,7 @@ TABLE
array('ISBN', 'Title'),
array(),
'default',
-<<<TABLE
+<<<'TABLE'
+------+-------+
| ISBN | Title |
+------+-------+
@@ -226,7 +227,7 @@ TABLE
array('9971-5-0210-0', 'A Tale of Two Cities', '<info>Charles Dickens</>'),
),
'default',
-<<<TABLE
+<<<'TABLE'
+---------------+----------------------+-----------------+
| ISBN | Title | Author |
+---------------+----------------------+-----------------+
@@ -243,7 +244,7 @@ TABLE
array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'),
),
'default',
-<<<TABLE
+<<<'TABLE'
+----------------------------------+----------------------+-----------------+
| ISBN | Title | Author |
+----------------------------------+----------------------+-----------------+
@@ -275,7 +276,7 @@ TABLE
),
),
'default',
-<<<TABLE
+<<<'TABLE'
+-------------------------------+-------------------------------+-----------------------------+
| ISBN | Title | Author |
+-------------------------------+-------------------------------+-----------------------------+
@@ -298,29 +299,29 @@ TABLE
array(
array(
new TableCell('9971-5-0210-0', array('rowspan' => 3)),
- 'Divine Comedy',
+ new TableCell('Divine Comedy', array('rowspan' => 2)),
'Dante Alighieri',
),
- array('A Tale of Two Cities', 'Charles Dickens'),
+ array(),
array("The Lord of \nthe Rings", "J. R. \nR. Tolkien"),
new TableSeparator(),
array('80-902734-1-6', new TableCell("And Then \nThere \nWere None", array('rowspan' => 3)), 'Agatha Christie'),
array('80-902734-1-7', 'Test'),
),
'default',
-<<<TABLE
-+---------------+----------------------+-----------------+
-| ISBN | Title | Author |
-+---------------+----------------------+-----------------+
-| 9971-5-0210-0 | Divine Comedy | Dante Alighieri |
-| | A Tale of Two Cities | Charles Dickens |
-| | The Lord of | J. R. |
-| | the Rings | R. Tolkien |
-+---------------+----------------------+-----------------+
-| 80-902734-1-6 | And Then | Agatha Christie |
-| 80-902734-1-7 | There | Test |
-| | Were None | |
-+---------------+----------------------+-----------------+
+<<<'TABLE'
++---------------+---------------+-----------------+
+| ISBN | Title | Author |
++---------------+---------------+-----------------+
+| 9971-5-0210-0 | Divine Comedy | Dante Alighieri |
+| | | |
+| | The Lord of | J. R. |
+| | the Rings | R. Tolkien |
++---------------+---------------+-----------------+
+| 80-902734-1-6 | And Then | Agatha Christie |
+| 80-902734-1-7 | There | Test |
+| | Were None | |
++---------------+---------------+-----------------+
TABLE
),
@@ -341,7 +342,7 @@ TABLE
array('J. R. R'),
),
'default',
-<<<TABLE
+<<<'TABLE'
+------------------+---------+-----------------+
| ISBN | Title | Author |
+------------------+---------+-----------------+
@@ -376,7 +377,7 @@ TABLE
),
),
'default',
-<<<TABLE
+<<<'TABLE'
+-----------------+-------+-----------------+
| ISBN | Title | Author |
+-----------------+-------+-----------------+
@@ -413,7 +414,7 @@ TABLE
array('Charles Dickens'),
),
'default',
-<<<TABLE
+<<<'TABLE'
+-----------------+-------+-----------------+
| ISBN | Title | Author |
+-----------------+-------+-----------------+
@@ -440,7 +441,7 @@ TABLE
array('Charles Dickens'),
),
'default',
-<<<TABLE
+<<<'TABLE'
+---------------+-----------------+
| ISBN | Author |
+---------------+-----------------+
@@ -458,7 +459,7 @@ TABLE
),
array(),
'default',
-<<<TABLE
+<<<'TABLE'
+------+-------+--------+
| Main title |
+------+-------+--------+
@@ -478,13 +479,71 @@ TABLE
),
),
'default',
-<<<TABLE
+<<<'TABLE'
+---+--+--+---+--+---+--+---+--+
| 1 | 2 | 3 | 4 |
+---+--+--+---+--+---+--+---+--+
TABLE
),
+ 'Coslpan and table cells with comment style' => array(
+ array(
+ new TableCell('<comment>Long Title</comment>', array('colspan' => 3)),
+ ),
+ array(
+ array(
+ new TableCell('9971-5-0210-0', array('colspan' => 3)),
+ ),
+ new TableSeparator(),
+ array(
+ 'Dante Alighieri',
+ 'J. R. R. Tolkien',
+ 'J. R. R',
+ ),
+ ),
+ 'default',
+ <<<TABLE
++-----------------+------------------+---------+
+|\033[32m \033[39m\033[33mLong Title\033[39m\033[32m \033[39m|
++-----------------+------------------+---------+
+| 9971-5-0210-0 |
++-----------------+------------------+---------+
+| Dante Alighieri | J. R. R. Tolkien | J. R. R |
++-----------------+------------------+---------+
+
+TABLE
+ ,
+ true,
+ ),
+ 'Row with formatted cells containing a newline' => array(
+ array(),
+ array(
+ array(
+ new TableCell('<error>Dont break'."\n".'here</error>', array('colspan' => 2)),
+ ),
+ new TableSeparator(),
+ array(
+ 'foo',
+ new TableCell('<error>Dont break'."\n".'here</error>', array('rowspan' => 2)),
+ ),
+ array(
+ 'bar',
+ ),
+ ),
+ 'default',
+ <<<'TABLE'
++-------+------------+
+| Dont break |
+| here |
++-------+------------+
+| foo | Dont break |
+| bar | here |
++-------+------------+
+
+TABLE
+ ,
+ true,
+ ),
);
}
@@ -499,7 +558,7 @@ TABLE
$table->render();
$expected =
-<<<TABLE
+<<<'TABLE'
+------+
| ■■ |
+------+
@@ -511,6 +570,42 @@ TABLE;
$this->assertEquals($expected, $this->getOutputContent($output));
}
+ public function testTableCellWithNumericIntValue()
+ {
+ $table = new Table($output = $this->getOutputStream());
+
+ $table->setRows(array(array(new TableCell(12345))));
+ $table->render();
+
+ $expected =
+<<<'TABLE'
++-------+
+| 12345 |
++-------+
+
+TABLE;
+
+ $this->assertEquals($expected, $this->getOutputContent($output));
+ }
+
+ public function testTableCellWithNumericFloatValue()
+ {
+ $table = new Table($output = $this->getOutputStream());
+
+ $table->setRows(array(array(new TableCell(12345.01))));
+ $table->render();
+
+ $expected =
+<<<'TABLE'
++----------+
+| 12345.01 |
++----------+
+
+TABLE;
+
+ $this->assertEquals($expected, $this->getOutputContent($output));
+ }
+
public function testStyle()
{
$style = new TableStyle();
@@ -529,7 +624,7 @@ TABLE;
$table->render();
$expected =
-<<<TABLE
+<<<'TABLE'
.......
. Foo .
.......
@@ -556,7 +651,7 @@ TABLE;
$table->render();
$expected =
-<<<TABLE
+<<<'TABLE'
+------+
| Foo |
+------+
@@ -631,9 +726,91 @@ TABLE;
$this->assertEquals($expected, $this->getOutputContent($output));
}
- protected function getOutputStream()
+ public function testColumnWith()
+ {
+ $table = new Table($output = $this->getOutputStream());
+ $table
+ ->setHeaders(array('ISBN', 'Title', 'Author', 'Price'))
+ ->setRows(array(
+ array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri', '9.95'),
+ array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens', '139.25'),
+ ))
+ ->setColumnWidth(0, 15)
+ ->setColumnWidth(3, 10);
+
+ $style = new TableStyle();
+ $style->setPadType(STR_PAD_LEFT);
+ $table->setColumnStyle(3, $style);
+
+ $table->render();
+
+ $expected =
+ <<<TABLE
++-----------------+----------------------+-----------------+------------+
+| ISBN | Title | Author | Price |
++-----------------+----------------------+-----------------+------------+
+| 99921-58-10-7 | Divine Comedy | Dante Alighieri | 9.95 |
+| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | 139.25 |
++-----------------+----------------------+-----------------+------------+
+
+TABLE;
+
+ $this->assertEquals($expected, $this->getOutputContent($output));
+ }
+
+ public function testColumnWiths()
+ {
+ $table = new Table($output = $this->getOutputStream());
+ $table
+ ->setHeaders(array('ISBN', 'Title', 'Author', 'Price'))
+ ->setRows(array(
+ array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri', '9.95'),
+ array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens', '139.25'),
+ ))
+ ->setColumnWidths(array(15, 0, -1, 10));
+
+ $style = new TableStyle();
+ $style->setPadType(STR_PAD_LEFT);
+ $table->setColumnStyle(3, $style);
+
+ $table->render();
+
+ $expected =
+ <<<TABLE
++-----------------+----------------------+-----------------+------------+
+| ISBN | Title | Author | Price |
++-----------------+----------------------+-----------------+------------+
+| 99921-58-10-7 | Divine Comedy | Dante Alighieri | 9.95 |
+| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | 139.25 |
++-----------------+----------------------+-----------------+------------+
+
+TABLE;
+
+ $this->assertEquals($expected, $this->getOutputContent($output));
+ }
+
+ /**
+ * @expectedException \Symfony\Component\Console\Exception\InvalidArgumentException
+ * @expectedExceptionMessage Style "absent" is not defined.
+ */
+ public function testIsNotDefinedStyleException()
+ {
+ $table = new Table($this->getOutputStream());
+ $table->setStyle('absent');
+ }
+
+ /**
+ * @expectedException \Symfony\Component\Console\Exception\InvalidArgumentException
+ * @expectedExceptionMessage Style "absent" is not defined.
+ */
+ public function testGetStyleDefinition()
+ {
+ Table::getStyleDefinition('absent');
+ }
+
+ protected function getOutputStream($decorated = false)
{
- return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, false);
+ return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, $decorated);
}
protected function getOutputContent(StreamOutput $output)
diff --git a/vendor/symfony/console/Tests/Input/ArgvInputTest.php b/vendor/symfony/console/Tests/Input/ArgvInputTest.php
index d2c540e6..01d6e4b9 100644
--- a/vendor/symfony/console/Tests/Input/ArgvInputTest.php
+++ b/vendor/symfony/console/Tests/Input/ArgvInputTest.php
@@ -11,12 +11,13 @@
namespace Symfony\Component\Console\Tests\Input;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
-class ArgvInputTest extends \PHPUnit_Framework_TestCase
+class ArgvInputTest extends TestCase
{
public function testConstructor()
{
@@ -47,7 +48,7 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase
$input = new ArgvInput($input);
$input->bind(new InputDefinition($options));
- $this->assertEquals($expectedOptions, $input->getOptions(), $message);
+ $this->assertSame($expectedOptions, $input->getOptions(), $message);
}
public function provideOptions()
@@ -72,6 +73,36 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase
'->parse() parses long options with a required value (with a space separator)',
),
array(
+ array('cli.php', '--foo='),
+ array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)),
+ array('foo' => ''),
+ '->parse() parses long options with optional value which is empty (with a = separator) as empty string',
+ ),
+ array(
+ array('cli.php', '--foo=', 'bar'),
+ array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::REQUIRED)),
+ array('foo' => ''),
+ '->parse() parses long options with optional value without value specified or an empty string (with a = separator) followed by an argument as empty string',
+ ),
+ array(
+ array('cli.php', 'bar', '--foo'),
+ array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::REQUIRED)),
+ array('foo' => null),
+ '->parse() parses long options with optional value which is empty (with a = separator) preceded by an argument',
+ ),
+ array(
+ array('cli.php', '--foo', '', 'bar'),
+ array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::REQUIRED)),
+ array('foo' => ''),
+ '->parse() parses long options with optional value which is empty as empty string even followed by an argument',
+ ),
+ array(
+ array('cli.php', '--foo'),
+ array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)),
+ array('foo' => null),
+ '->parse() parses long options with optional value specified with no separator and no value as null',
+ ),
+ array(
array('cli.php', '-f'),
array(new InputOption('foo', 'f')),
array('foo' => true),
@@ -151,7 +182,12 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase
*/
public function testInvalidInput($argv, $definition, $expectedExceptionMessage)
{
- $this->setExpectedException('RuntimeException', $expectedExceptionMessage);
+ if (method_exists($this, 'expectException')) {
+ $this->expectException('RuntimeException');
+ $this->expectExceptionMessage($expectedExceptionMessage);
+ } else {
+ $this->setExpectedException('RuntimeException', $expectedExceptionMessage);
+ }
$input = new ArgvInput($argv);
$input->bind($definition);
@@ -183,7 +219,17 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase
array(
array('cli.php', 'foo', 'bar'),
new InputDefinition(),
- 'Too many arguments.',
+ 'No arguments expected, got "foo".',
+ ),
+ array(
+ array('cli.php', 'foo', 'bar'),
+ new InputDefinition(array(new InputArgument('number'))),
+ 'Too many arguments, expected arguments "number".',
+ ),
+ array(
+ array('cli.php', 'foo', 'bar', 'zzz'),
+ new InputDefinition(array(new InputArgument('number'), new InputArgument('county'))),
+ 'Too many arguments, expected arguments "number" "county".',
),
array(
array('cli.php', '--foo'),
@@ -224,14 +270,14 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase
$input = new ArgvInput(array('cli.php', '--name=foo', '--name=bar', '--name='));
$input->bind(new InputDefinition(array(new InputOption('name', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY))));
- $this->assertSame(array('name' => array('foo', 'bar', null)), $input->getOptions(), '->parse() parses empty array options as null ("--option=value" syntax)');
+ $this->assertSame(array('name' => array('foo', 'bar', '')), $input->getOptions(), '->parse() parses empty array options as null ("--option=value" syntax)');
$input = new ArgvInput(array('cli.php', '--name', 'foo', '--name', 'bar', '--name', '--anotherOption'));
$input->bind(new InputDefinition(array(
new InputOption('name', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY),
new InputOption('anotherOption', null, InputOption::VALUE_NONE),
)));
- $this->assertSame(array('name' => array('foo', 'bar', null), 'anotherOption' => true), $input->getOptions(), '->parse() parses empty array options as null ("--option value" syntax)');
+ $this->assertSame(array('name' => array('foo', 'bar', null), 'anotherOption' => true), $input->getOptions(), '->parse() parses empty array options ("--option value" syntax)');
}
public function testParseNegativeNumberAfterDoubleDash()
@@ -268,6 +314,12 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase
$input = new ArgvInput(array('cli.php', '-f', 'foo'));
$this->assertTrue($input->hasParameterOption('-f'), '->hasParameterOption() returns true if the given short option is in the raw input');
+ $input = new ArgvInput(array('cli.php', '-fh'));
+ $this->assertTrue($input->hasParameterOption('-fh'), '->hasParameterOption() returns true if the given short option is in the raw input');
+
+ $input = new ArgvInput(array('cli.php', '-e=test'));
+ $this->assertFalse($input->hasParameterOption('-s'), '->hasParameterOption() returns true if the given short option is in the raw input');
+
$input = new ArgvInput(array('cli.php', '--foo', 'foo'));
$this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given short option is in the raw input');
@@ -278,6 +330,21 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given option with provided value is in the raw input');
}
+ public function testHasParameterOptionOnlyOptions()
+ {
+ $input = new ArgvInput(array('cli.php', '-f', 'foo'));
+ $this->assertTrue($input->hasParameterOption('-f', true), '->hasParameterOption() returns true if the given short option is in the raw input');
+
+ $input = new ArgvInput(array('cli.php', '--foo', '--', 'foo'));
+ $this->assertTrue($input->hasParameterOption('--foo', true), '->hasParameterOption() returns true if the given long option is in the raw input');
+
+ $input = new ArgvInput(array('cli.php', '--foo=bar', 'foo'));
+ $this->assertTrue($input->hasParameterOption('--foo', true), '->hasParameterOption() returns true if the given long option with provided value is in the raw input');
+
+ $input = new ArgvInput(array('cli.php', '--', '--foo'));
+ $this->assertFalse($input->hasParameterOption('--foo', true), '->hasParameterOption() returns false if the given option is in the raw input but after an end of options signal');
+ }
+
public function testToString()
{
$input = new ArgvInput(array('cli.php', '-f', 'foo'));
@@ -290,21 +357,25 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase
/**
* @dataProvider provideGetParameterOptionValues
*/
- public function testGetParameterOptionEqualSign($argv, $key, $expected)
+ public function testGetParameterOptionEqualSign($argv, $key, $onlyParams, $expected)
{
$input = new ArgvInput($argv);
- $this->assertEquals($expected, $input->getParameterOption($key), '->getParameterOption() returns the expected value');
+ $this->assertEquals($expected, $input->getParameterOption($key, false, $onlyParams), '->getParameterOption() returns the expected value');
}
public function provideGetParameterOptionValues()
{
return array(
- array(array('app/console', 'foo:bar', '-e', 'dev'), '-e', 'dev'),
- array(array('app/console', 'foo:bar', '--env=dev'), '--env', 'dev'),
- array(array('app/console', 'foo:bar', '-e', 'dev'), array('-e', '--env'), 'dev'),
- array(array('app/console', 'foo:bar', '--env=dev'), array('-e', '--env'), 'dev'),
- array(array('app/console', 'foo:bar', '--env=dev', '--en=1'), array('--en'), '1'),
- array(array('app/console', 'foo:bar', '--env=dev', '', '--en=1'), array('--en'), '1'),
+ array(array('app/console', 'foo:bar', '-e', 'dev'), '-e', false, 'dev'),
+ array(array('app/console', 'foo:bar', '--env=dev'), '--env', false, 'dev'),
+ array(array('app/console', 'foo:bar', '-e', 'dev'), array('-e', '--env'), false, 'dev'),
+ array(array('app/console', 'foo:bar', '--env=dev'), array('-e', '--env'), false, 'dev'),
+ array(array('app/console', 'foo:bar', '--env=dev', '--en=1'), array('--en'), false, '1'),
+ array(array('app/console', 'foo:bar', '--env=dev', '', '--en=1'), array('--en'), false, '1'),
+ array(array('app/console', 'foo:bar', '--env', 'val'), '--env', false, 'val'),
+ array(array('app/console', 'foo:bar', '--env', 'val', '--dummy'), '--env', false, 'val'),
+ array(array('app/console', 'foo:bar', '--', '--env=dev'), '--env', false, 'dev'),
+ array(array('app/console', 'foo:bar', '--', '--env=dev'), '--env', true, false),
);
}
@@ -314,4 +385,30 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase
$input->bind(new InputDefinition(array(new InputArgument('file'))));
$this->assertEquals(array('file' => '-'), $input->getArguments(), '->parse() parses single dash as an argument');
}
+
+ public function testParseOptionWithValueOptionalGivenEmptyAndRequiredArgument()
+ {
+ $input = new ArgvInput(array('cli.php', '--foo=', 'bar'));
+ $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::REQUIRED))));
+ $this->assertEquals(array('foo' => null), $input->getOptions(), '->parse() parses optional options with empty value as null');
+ $this->assertEquals(array('name' => 'bar'), $input->getArguments(), '->parse() parses required arguments');
+
+ $input = new ArgvInput(array('cli.php', '--foo=0', 'bar'));
+ $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::REQUIRED))));
+ $this->assertEquals(array('foo' => '0'), $input->getOptions(), '->parse() parses optional options with empty value as null');
+ $this->assertEquals(array('name' => 'bar'), $input->getArguments(), '->parse() parses required arguments');
+ }
+
+ public function testParseOptionWithValueOptionalGivenEmptyAndOptionalArgument()
+ {
+ $input = new ArgvInput(array('cli.php', '--foo=', 'bar'));
+ $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::OPTIONAL))));
+ $this->assertEquals(array('foo' => null), $input->getOptions(), '->parse() parses optional options with empty value as null');
+ $this->assertEquals(array('name' => 'bar'), $input->getArguments(), '->parse() parses optional arguments');
+
+ $input = new ArgvInput(array('cli.php', '--foo=0', 'bar'));
+ $input->bind(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputArgument('name', InputArgument::OPTIONAL))));
+ $this->assertEquals(array('foo' => '0'), $input->getOptions(), '->parse() parses optional options with empty value as null');
+ $this->assertEquals(array('name' => 'bar'), $input->getArguments(), '->parse() parses optional arguments');
+ }
}
diff --git a/vendor/symfony/console/Tests/Input/ArrayInputTest.php b/vendor/symfony/console/Tests/Input/ArrayInputTest.php
index cc89083c..3e858435 100644
--- a/vendor/symfony/console/Tests/Input/ArrayInputTest.php
+++ b/vendor/symfony/console/Tests/Input/ArrayInputTest.php
@@ -11,12 +11,13 @@
namespace Symfony\Component\Console\Tests\Input;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
-class ArrayInputTest extends \PHPUnit_Framework_TestCase
+class ArrayInputTest extends TestCase
{
public function testGetFirstArgument()
{
@@ -36,15 +37,24 @@ class ArrayInputTest extends \PHPUnit_Framework_TestCase
$input = new ArrayInput(array('--foo'));
$this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters');
+
+ $input = new ArrayInput(array('--foo', '--', '--bar'));
+ $this->assertTrue($input->hasParameterOption('--bar'), '->hasParameterOption() returns true if an option is present in the passed parameters');
+ $this->assertFalse($input->hasParameterOption('--bar', true), '->hasParameterOption() returns false if an option is present in the passed parameters after an end of options signal');
}
public function testGetParameterOption()
{
$input = new ArrayInput(array('name' => 'Fabien', '--foo' => 'bar'));
$this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name');
+ $this->assertFalse($input->getParameterOption('--bar'), '->getParameterOption() returns the default if an option is not present in the passed parameters');
$input = new ArrayInput(array('Fabien', '--foo' => 'bar'));
$this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name');
+
+ $input = new ArrayInput(array('--foo', '--', '--bar' => 'woop'));
+ $this->assertEquals('woop', $input->getParameterOption('--bar'), '->getParameterOption() returns the correct value if an option is present in the passed parameters');
+ $this->assertFalse($input->getParameterOption('--bar', false, true), '->getParameterOption() returns false if an option is present in the passed parameters after an end of options signal');
}
public function testParseArguments()
@@ -80,9 +90,15 @@ class ArrayInputTest extends \PHPUnit_Framework_TestCase
'->parse() parses long options with a default value',
),
array(
- array('--foo' => null),
+ array(),
array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')),
array('foo' => 'default'),
+ '->parse() uses the default value for long options with value optional which are not passed',
+ ),
+ array(
+ array('--foo' => null),
+ array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')),
+ array('foo' => null),
'->parse() parses long options with a default value',
),
array(
@@ -91,6 +107,18 @@ class ArrayInputTest extends \PHPUnit_Framework_TestCase
array('foo' => 'bar'),
'->parse() parses short options',
),
+ array(
+ array('--' => null, '-f' => 'bar'),
+ array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')),
+ array('foo' => 'default'),
+ '->parse() does not parse opts after an end of options signal',
+ ),
+ array(
+ array('--' => null),
+ array(),
+ array(),
+ '->parse() does not choke on end of options signal',
+ ),
);
}
@@ -99,7 +127,12 @@ class ArrayInputTest extends \PHPUnit_Framework_TestCase
*/
public function testParseInvalidInput($parameters, $definition, $expectedExceptionMessage)
{
- $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage);
+ if (method_exists($this, 'expectException')) {
+ $this->expectException('InvalidArgumentException');
+ $this->expectExceptionMessage($expectedExceptionMessage);
+ } else {
+ $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage);
+ }
new ArrayInput($parameters, $definition);
}
@@ -134,5 +167,8 @@ class ArrayInputTest extends \PHPUnit_Framework_TestCase
{
$input = new ArrayInput(array('-f' => null, '-b' => 'bar', '--foo' => 'b a z', '--lala' => null, 'test' => 'Foo', 'test2' => "A\nB'C"));
$this->assertEquals('-f -b=bar --foo='.escapeshellarg('b a z').' --lala Foo '.escapeshellarg("A\nB'C"), (string) $input);
+
+ $input = new ArrayInput(array('-b' => array('bval_1', 'bval_2'), '--f' => array('fval_1', 'fval_2')));
+ $this->assertSame('-b=bval_1 -b=bval_2 --f=fval_1 --f=fval_2', (string) $input);
}
}
diff --git a/vendor/symfony/console/Tests/Input/InputArgumentTest.php b/vendor/symfony/console/Tests/Input/InputArgumentTest.php
index cfb37cd4..66af98b3 100644
--- a/vendor/symfony/console/Tests/Input/InputArgumentTest.php
+++ b/vendor/symfony/console/Tests/Input/InputArgumentTest.php
@@ -11,9 +11,10 @@
namespace Symfony\Component\Console\Tests\Input;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\InputArgument;
-class InputArgumentTest extends \PHPUnit_Framework_TestCase
+class InputArgumentTest extends TestCase
{
public function testConstructor()
{
@@ -41,7 +42,12 @@ class InputArgumentTest extends \PHPUnit_Framework_TestCase
*/
public function testInvalidModes($mode)
{
- $this->setExpectedException('InvalidArgumentException', sprintf('Argument mode "%s" is not valid.', $mode));
+ if (method_exists($this, 'expectException')) {
+ $this->expectException('InvalidArgumentException');
+ $this->expectExceptionMessage(sprintf('Argument mode "%s" is not valid.', $mode));
+ } else {
+ $this->setExpectedException('InvalidArgumentException', sprintf('Argument mode "%s" is not valid.', $mode));
+ }
new InputArgument('foo', $mode);
}
diff --git a/vendor/symfony/console/Tests/Input/InputDefinitionTest.php b/vendor/symfony/console/Tests/Input/InputDefinitionTest.php
index 7e0a2425..1374ddfd 100644
--- a/vendor/symfony/console/Tests/Input/InputDefinitionTest.php
+++ b/vendor/symfony/console/Tests/Input/InputDefinitionTest.php
@@ -11,15 +11,19 @@
namespace Symfony\Component\Console\Tests\Input;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
-class InputDefinitionTest extends \PHPUnit_Framework_TestCase
+class InputDefinitionTest extends TestCase
{
protected static $fixtures;
- protected $foo, $bar, $foo1, $foo2;
+ protected $foo;
+ protected $bar;
+ protected $foo1;
+ protected $foo2;
public static function setUpBeforeClass()
{
@@ -383,41 +387,6 @@ class InputDefinitionTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('[options] [--] [<cat>]', $definition->getSynopsis(true), '->getSynopsis(true) groups options in [options]');
}
- /**
- * @group legacy
- */
- public function testLegacyAsText()
- {
- $definition = new InputDefinition(array(
- new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'),
- new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true),
- new InputArgument('bar', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'The bar argument', array('http://foo.com/')),
- new InputOption('foo', 'f', InputOption::VALUE_REQUIRED, 'The foo option'),
- new InputOption('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false),
- new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'),
- new InputOption('qux', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux option', array('http://foo.com/', 'bar')),
- new InputOption('qux2', '', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The qux2 option', array('foo' => 'bar')),
- ));
-
- $this->assertStringEqualsFile(self::$fixtures.'/definition_astext.txt', $definition->asText(), '->asText() returns a textual representation of the InputDefinition');
- }
-
- /**
- * @group legacy
- */
- public function testLegacyAsXml()
- {
- $definition = new InputDefinition(array(
- new InputArgument('foo', InputArgument::OPTIONAL, 'The foo argument'),
- new InputArgument('baz', InputArgument::OPTIONAL, 'The baz argument', true),
- new InputArgument('bar', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'The bar argument', array('bar')),
- new InputOption('foo', 'f', InputOption::VALUE_REQUIRED, 'The foo option'),
- new InputOption('baz', null, InputOption::VALUE_OPTIONAL, 'The baz option', false),
- new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL, 'The bar option', 'bar'),
- ));
- $this->assertXmlStringEqualsXmlFile(self::$fixtures.'/definition_asxml.txt', $definition->asXml(), '->asXml() returns an XML representation of the InputDefinition');
- }
-
protected function initializeArguments()
{
$this->foo = new InputArgument('foo');
diff --git a/vendor/symfony/console/Tests/Input/InputOptionTest.php b/vendor/symfony/console/Tests/Input/InputOptionTest.php
index 53ce1df8..943bf607 100644
--- a/vendor/symfony/console/Tests/Input/InputOptionTest.php
+++ b/vendor/symfony/console/Tests/Input/InputOptionTest.php
@@ -11,9 +11,10 @@
namespace Symfony\Component\Console\Tests\Input;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\InputOption;
-class InputOptionTest extends \PHPUnit_Framework_TestCase
+class InputOptionTest extends TestCase
{
public function testConstructor()
{
@@ -77,7 +78,12 @@ class InputOptionTest extends \PHPUnit_Framework_TestCase
*/
public function testInvalidModes($mode)
{
- $this->setExpectedException('InvalidArgumentException', sprintf('Option mode "%s" is not valid.', $mode));
+ if (method_exists($this, 'expectException')) {
+ $this->expectException('InvalidArgumentException');
+ $this->expectExceptionMessage(sprintf('Option mode "%s" is not valid.', $mode));
+ } else {
+ $this->setExpectedException('InvalidArgumentException', sprintf('Option mode "%s" is not valid.', $mode));
+ }
new InputOption('foo', 'f', $mode);
}
diff --git a/vendor/symfony/console/Tests/Input/InputTest.php b/vendor/symfony/console/Tests/Input/InputTest.php
index eb1c6617..4410d2f5 100644
--- a/vendor/symfony/console/Tests/Input/InputTest.php
+++ b/vendor/symfony/console/Tests/Input/InputTest.php
@@ -11,12 +11,13 @@
namespace Symfony\Component\Console\Tests\Input;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
-class InputTest extends \PHPUnit_Framework_TestCase
+class InputTest extends TestCase
{
public function testConstructor()
{
@@ -36,6 +37,14 @@ class InputTest extends \PHPUnit_Framework_TestCase
$input = new ArrayInput(array('--name' => 'foo'), new InputDefinition(array(new InputOption('name'), new InputOption('bar', '', InputOption::VALUE_OPTIONAL, '', 'default'))));
$this->assertEquals('default', $input->getOption('bar'), '->getOption() returns the default value for optional options');
$this->assertEquals(array('name' => 'foo', 'bar' => 'default'), $input->getOptions(), '->getOptions() returns all option values, even optional ones');
+
+ $input = new ArrayInput(array('--name' => 'foo', '--bar' => ''), new InputDefinition(array(new InputOption('name'), new InputOption('bar', '', InputOption::VALUE_OPTIONAL, '', 'default'))));
+ $this->assertEquals('', $input->getOption('bar'), '->getOption() returns null for options explicitly passed without value (or an empty value)');
+ $this->assertEquals(array('name' => 'foo', 'bar' => ''), $input->getOptions(), '->getOptions() returns all option values.');
+
+ $input = new ArrayInput(array('--name' => 'foo', '--bar' => null), new InputDefinition(array(new InputOption('name'), new InputOption('bar', '', InputOption::VALUE_OPTIONAL, '', 'default'))));
+ $this->assertNull($input->getOption('bar'), '->getOption() returns null for options explicitly passed without value (or an empty value)');
+ $this->assertEquals(array('name' => 'foo', 'bar' => null), $input->getOptions(), '->getOptions() returns all option values');
}
/**
@@ -129,4 +138,12 @@ class InputTest extends \PHPUnit_Framework_TestCase
$input->setInteractive(false);
$this->assertFalse($input->isInteractive(), '->setInteractive() changes the interactive flag');
}
+
+ public function testSetGetStream()
+ {
+ $input = new ArrayInput(array());
+ $stream = fopen('php://memory', 'r+', false);
+ $input->setStream($stream);
+ $this->assertSame($stream, $input->getStream());
+ }
}
diff --git a/vendor/symfony/console/Tests/Input/StringInputTest.php b/vendor/symfony/console/Tests/Input/StringInputTest.php
index c8a560f6..f2e3467e 100644
--- a/vendor/symfony/console/Tests/Input/StringInputTest.php
+++ b/vendor/symfony/console/Tests/Input/StringInputTest.php
@@ -11,11 +11,12 @@
namespace Symfony\Component\Console\Tests\Input;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\StringInput;
-class StringInputTest extends \PHPUnit_Framework_TestCase
+class StringInputTest extends TestCase
{
/**
* @dataProvider getTokenizeData
@@ -41,19 +42,6 @@ class StringInputTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('bar', $input->getOption('foo'));
}
- /**
- * @group legacy
- */
- public function testLegacyInputOptionDefinitionInConstructor()
- {
- $definition = new InputDefinition(
- array(new InputOption('foo', null, InputOption::VALUE_REQUIRED))
- );
-
- $input = new StringInput('--foo=bar', $definition);
- $this->assertEquals('bar', $input->getOption('foo'));
- }
-
public function getTokenizeData()
{
return array(
diff --git a/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php b/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php
index c5eca2ca..734a153e 100644
--- a/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php
+++ b/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php
@@ -11,9 +11,11 @@
namespace Symfony\Component\Console\Tests\Logger;
-use Psr\Log\Test\LoggerInterfaceTest;
+use PHPUnit\Framework\TestCase;
+use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
use Symfony\Component\Console\Logger\ConsoleLogger;
+use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Tests\Fixtures\DummyOutput;
use Symfony\Component\Console\Output\OutputInterface;
@@ -21,8 +23,9 @@ use Symfony\Component\Console\Output\OutputInterface;
* Console logger test.
*
* @author Kévin Dunglas <dunglas@gmail.com>
+ * @author Jordi Boggiano <j.boggiano@seld.be>
*/
-class ConsoleLoggerTest extends LoggerInterfaceTest
+class ConsoleLoggerTest extends TestCase
{
/**
* @var DummyOutput
@@ -30,7 +33,7 @@ class ConsoleLoggerTest extends LoggerInterfaceTest
protected $output;
/**
- * {@inheritdoc}
+ * @return LoggerInterface
*/
public function getLogger()
{
@@ -49,10 +52,164 @@ class ConsoleLoggerTest extends LoggerInterfaceTest
}
/**
- * {@inheritdoc}
+ * Return the log messages in order.
+ *
+ * @return string[]
*/
public function getLogs()
{
return $this->output->getLogs();
}
+
+ /**
+ * @dataProvider provideOutputMappingParams
+ */
+ public function testOutputMapping($logLevel, $outputVerbosity, $isOutput, $addVerbosityLevelMap = array())
+ {
+ $out = new BufferedOutput($outputVerbosity);
+ $logger = new ConsoleLogger($out, $addVerbosityLevelMap);
+ $logger->log($logLevel, 'foo bar');
+ $logs = $out->fetch();
+ $this->assertEquals($isOutput ? "[$logLevel] foo bar".PHP_EOL : '', $logs);
+ }
+
+ public function provideOutputMappingParams()
+ {
+ $quietMap = array(LogLevel::EMERGENCY => OutputInterface::VERBOSITY_QUIET);
+
+ return array(
+ array(LogLevel::EMERGENCY, OutputInterface::VERBOSITY_NORMAL, true),
+ array(LogLevel::WARNING, OutputInterface::VERBOSITY_NORMAL, true),
+ array(LogLevel::INFO, OutputInterface::VERBOSITY_NORMAL, false),
+ array(LogLevel::DEBUG, OutputInterface::VERBOSITY_NORMAL, false),
+ array(LogLevel::INFO, OutputInterface::VERBOSITY_VERBOSE, false),
+ array(LogLevel::INFO, OutputInterface::VERBOSITY_VERY_VERBOSE, true),
+ array(LogLevel::DEBUG, OutputInterface::VERBOSITY_VERY_VERBOSE, false),
+ array(LogLevel::DEBUG, OutputInterface::VERBOSITY_DEBUG, true),
+ array(LogLevel::ALERT, OutputInterface::VERBOSITY_QUIET, false),
+ array(LogLevel::EMERGENCY, OutputInterface::VERBOSITY_QUIET, false),
+ array(LogLevel::ALERT, OutputInterface::VERBOSITY_QUIET, false, $quietMap),
+ array(LogLevel::EMERGENCY, OutputInterface::VERBOSITY_QUIET, true, $quietMap),
+ );
+ }
+
+ public function testHasErrored()
+ {
+ $logger = new ConsoleLogger(new BufferedOutput());
+
+ $this->assertFalse($logger->hasErrored());
+
+ $logger->warning('foo');
+ $this->assertFalse($logger->hasErrored());
+
+ $logger->error('bar');
+ $this->assertTrue($logger->hasErrored());
+ }
+
+ public function testImplements()
+ {
+ $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger());
+ }
+
+ /**
+ * @dataProvider provideLevelsAndMessages
+ */
+ public function testLogsAtAllLevels($level, $message)
+ {
+ $logger = $this->getLogger();
+ $logger->{$level}($message, array('user' => 'Bob'));
+ $logger->log($level, $message, array('user' => 'Bob'));
+
+ $expected = array(
+ $level.' message of level '.$level.' with context: Bob',
+ $level.' message of level '.$level.' with context: Bob',
+ );
+ $this->assertEquals($expected, $this->getLogs());
+ }
+
+ public function provideLevelsAndMessages()
+ {
+ return array(
+ LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'),
+ LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'),
+ LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'),
+ LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'),
+ LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'),
+ LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'),
+ LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'),
+ LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'),
+ );
+ }
+
+ /**
+ * @expectedException \Psr\Log\InvalidArgumentException
+ */
+ public function testThrowsOnInvalidLevel()
+ {
+ $logger = $this->getLogger();
+ $logger->log('invalid level', 'Foo');
+ }
+
+ public function testContextReplacement()
+ {
+ $logger = $this->getLogger();
+ $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));
+
+ $expected = array('info {Message {nothing} Bob Bar a}');
+ $this->assertEquals($expected, $this->getLogs());
+ }
+
+ public function testObjectCastToString()
+ {
+ if (method_exists($this, 'createPartialMock')) {
+ $dummy = $this->createPartialMock('Symfony\Component\Console\Tests\Logger\DummyTest', array('__toString'));
+ } else {
+ $dummy = $this->getMock('Symfony\Component\Console\Tests\Logger\DummyTest', array('__toString'));
+ }
+ $dummy->method('__toString')->will($this->returnValue('DUMMY'));
+
+ $this->getLogger()->warning($dummy);
+
+ $expected = array('warning DUMMY');
+ $this->assertEquals($expected, $this->getLogs());
+ }
+
+ public function testContextCanContainAnything()
+ {
+ $context = array(
+ 'bool' => true,
+ 'null' => null,
+ 'string' => 'Foo',
+ 'int' => 0,
+ 'float' => 0.5,
+ 'nested' => array('with object' => new DummyTest()),
+ 'object' => new \DateTime(),
+ 'resource' => fopen('php://memory', 'r'),
+ );
+
+ $this->getLogger()->warning('Crazy context data', $context);
+
+ $expected = array('warning Crazy context data');
+ $this->assertEquals($expected, $this->getLogs());
+ }
+
+ public function testContextExceptionKeyCanBeExceptionOrOtherValues()
+ {
+ $logger = $this->getLogger();
+ $logger->warning('Random message', array('exception' => 'oops'));
+ $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail')));
+
+ $expected = array(
+ 'warning Random message',
+ 'critical Uncaught Exception!',
+ );
+ $this->assertEquals($expected, $this->getLogs());
+ }
+}
+
+class DummyTest
+{
+ public function __toString()
+ {
+ }
}
diff --git a/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php b/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php
index 1afbbb6e..db39a02b 100644
--- a/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php
+++ b/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php
@@ -11,10 +11,12 @@
namespace Symfony\Component\Console\Tests\Output;
+use PHPUnit\Framework\TestCase;
+use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Output\Output;
-class ConsoleOutputTest extends \PHPUnit_Framework_TestCase
+class ConsoleOutputTest extends TestCase
{
public function testConstructor()
{
@@ -22,4 +24,19 @@ class ConsoleOutputTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument');
$this->assertSame($output->getFormatter(), $output->getErrorOutput()->getFormatter(), '__construct() takes a formatter or null as the third argument');
}
+
+ public function testSetFormatter()
+ {
+ $output = new ConsoleOutput();
+ $outputFormatter = new OutputFormatter();
+ $output->setFormatter($outputFormatter);
+ $this->assertSame($outputFormatter, $output->getFormatter());
+ }
+
+ public function testSetVerbosity()
+ {
+ $output = new ConsoleOutput();
+ $output->setVerbosity(Output::VERBOSITY_VERBOSE);
+ $this->assertSame(Output::VERBOSITY_VERBOSE, $output->getVerbosity());
+ }
}
diff --git a/vendor/symfony/console/Tests/Output/NullOutputTest.php b/vendor/symfony/console/Tests/Output/NullOutputTest.php
index b20ae4e8..b7ff4be3 100644
--- a/vendor/symfony/console/Tests/Output/NullOutputTest.php
+++ b/vendor/symfony/console/Tests/Output/NullOutputTest.php
@@ -11,10 +11,13 @@
namespace Symfony\Component\Console\Tests\Output;
+use PHPUnit\Framework\TestCase;
+use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Output\NullOutput;
+use Symfony\Component\Console\Output\Output;
use Symfony\Component\Console\Output\OutputInterface;
-class NullOutputTest extends \PHPUnit_Framework_TestCase
+class NullOutputTest extends TestCase
{
public function testConstructor()
{
@@ -36,4 +39,50 @@ class NullOutputTest extends \PHPUnit_Framework_TestCase
$output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
$this->assertSame(OutputInterface::VERBOSITY_QUIET, $output->getVerbosity(), '->getVerbosity() always returns VERBOSITY_QUIET for NullOutput');
}
+
+ public function testSetFormatter()
+ {
+ $output = new NullOutput();
+ $outputFormatter = new OutputFormatter();
+ $output->setFormatter($outputFormatter);
+ $this->assertNotSame($outputFormatter, $output->getFormatter());
+ }
+
+ public function testSetVerbosity()
+ {
+ $output = new NullOutput();
+ $output->setVerbosity(Output::VERBOSITY_NORMAL);
+ $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity());
+ }
+
+ public function testSetDecorated()
+ {
+ $output = new NullOutput();
+ $output->setDecorated(true);
+ $this->assertFalse($output->isDecorated());
+ }
+
+ public function testIsQuiet()
+ {
+ $output = new NullOutput();
+ $this->assertTrue($output->isQuiet());
+ }
+
+ public function testIsVerbose()
+ {
+ $output = new NullOutput();
+ $this->assertFalse($output->isVerbose());
+ }
+
+ public function testIsVeryVerbose()
+ {
+ $output = new NullOutput();
+ $this->assertFalse($output->isVeryVerbose());
+ }
+
+ public function testIsDebug()
+ {
+ $output = new NullOutput();
+ $this->assertFalse($output->isDebug());
+ }
}
diff --git a/vendor/symfony/console/Tests/Output/OutputTest.php b/vendor/symfony/console/Tests/Output/OutputTest.php
index 45e6ddc7..d8330d0b 100644
--- a/vendor/symfony/console/Tests/Output/OutputTest.php
+++ b/vendor/symfony/console/Tests/Output/OutputTest.php
@@ -11,10 +11,11 @@
namespace Symfony\Component\Console\Tests\Output;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Output\Output;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
-class OutputTest extends \PHPUnit_Framework_TestCase
+class OutputTest extends TestCase
{
public function testConstructor()
{
diff --git a/vendor/symfony/console/Tests/Output/StreamOutputTest.php b/vendor/symfony/console/Tests/Output/StreamOutputTest.php
index 2fd4f612..780b5681 100644
--- a/vendor/symfony/console/Tests/Output/StreamOutputTest.php
+++ b/vendor/symfony/console/Tests/Output/StreamOutputTest.php
@@ -11,10 +11,11 @@
namespace Symfony\Component\Console\Tests\Output;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Output\Output;
use Symfony\Component\Console\Output\StreamOutput;
-class StreamOutputTest extends \PHPUnit_Framework_TestCase
+class StreamOutputTest extends TestCase
{
protected $stream;
diff --git a/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php b/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php
index 889a9c82..865bb33f 100644
--- a/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php
+++ b/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php
@@ -11,14 +11,16 @@
namespace Symfony\Component\Console\Tests\Style;
-use PHPUnit_Framework_TestCase;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Tester\CommandTester;
+use Symfony\Component\Console\Formatter\OutputFormatter;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Output\ConsoleOutputInterface;
+use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
-use Symfony\Component\Console\Tester\CommandTester;
-class SymfonyStyleTest extends PHPUnit_Framework_TestCase
+class SymfonyStyleTest extends TestCase
{
/** @var Command */
protected $command;
@@ -27,12 +29,14 @@ class SymfonyStyleTest extends PHPUnit_Framework_TestCase
protected function setUp()
{
+ putenv('COLUMNS=121');
$this->command = new Command('sfstyle');
$this->tester = new CommandTester($this->command);
}
protected function tearDown()
{
+ putenv('COLUMNS');
$this->command = null;
$this->tester = null;
}
@@ -48,6 +52,24 @@ class SymfonyStyleTest extends PHPUnit_Framework_TestCase
$this->assertStringEqualsFile($outputFilepath, $this->tester->getDisplay(true));
}
+ /**
+ * @dataProvider inputInteractiveCommandToOutputFilesProvider
+ */
+ public function testInteractiveOutputs($inputCommandFilepath, $outputFilepath)
+ {
+ $code = require $inputCommandFilepath;
+ $this->command->setCode($code);
+ $this->tester->execute(array(), array('interactive' => true, 'decorated' => false));
+ $this->assertStringEqualsFile($outputFilepath, $this->tester->getDisplay(true));
+ }
+
+ public function inputInteractiveCommandToOutputFilesProvider()
+ {
+ $baseDir = __DIR__.'/../Fixtures/Style/SymfonyStyle';
+
+ return array_map(null, glob($baseDir.'/command/interactive_command_*.php'), glob($baseDir.'/output/interactive_output_*.txt'));
+ }
+
public function inputCommandToOutputFilesProvider()
{
$baseDir = __DIR__.'/../Fixtures/Style/SymfonyStyle';
@@ -55,35 +77,40 @@ class SymfonyStyleTest extends PHPUnit_Framework_TestCase
return array_map(null, glob($baseDir.'/command/command_*.php'), glob($baseDir.'/output/output_*.txt'));
}
- public function testLongWordsBlockWrapping()
+ public function testGetErrorStyle()
{
- $word = 'Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygovgollhjvhvljfezefeqifzeiqgiqzhrsdgihqzridghqridghqirshdghdghieridgheirhsdgehrsdvhqrsidhqshdgihrsidvqhneriqsdvjzergetsrfhgrstsfhsetsfhesrhdgtesfhbzrtfbrztvetbsdfbrsdfbrn';
- $wordLength = strlen($word);
- $maxLineLength = SymfonyStyle::MAX_LINE_LENGTH - 3;
+ $input = $this->getMockBuilder(InputInterface::class)->getMock();
- $this->command->setCode(function (InputInterface $input, OutputInterface $output) use ($word) {
- $sfStyle = new SymfonyStyleWithForcedLineLength($input, $output);
- $sfStyle->block($word, 'CUSTOM', 'fg=white;bg=blue', ' § ', false);
- });
+ $errorOutput = $this->getMockBuilder(OutputInterface::class)->getMock();
+ $errorOutput
+ ->method('getFormatter')
+ ->willReturn(new OutputFormatter());
+ $errorOutput
+ ->expects($this->once())
+ ->method('write');
- $this->tester->execute(array(), array('interactive' => false, 'decorated' => false));
- $expectedCount = (int) ceil($wordLength / ($maxLineLength)) + (int) ($wordLength > $maxLineLength - 5);
- $this->assertSame($expectedCount, substr_count($this->tester->getDisplay(true), ' § '));
+ $output = $this->getMockBuilder(ConsoleOutputInterface::class)->getMock();
+ $output
+ ->method('getFormatter')
+ ->willReturn(new OutputFormatter());
+ $output
+ ->expects($this->once())
+ ->method('getErrorOutput')
+ ->willReturn($errorOutput);
+
+ $io = new SymfonyStyle($input, $output);
+ $io->getErrorStyle()->write('');
}
-}
-/**
- * Use this class in tests to force the line length
- * and ensure a consistent output for expectations.
- */
-class SymfonyStyleWithForcedLineLength extends SymfonyStyle
-{
- public function __construct(InputInterface $input, OutputInterface $output)
+ public function testGetErrorStyleUsesTheCurrentOutputIfNoErrorOutputIsAvailable()
{
- parent::__construct($input, $output);
+ $output = $this->getMockBuilder(OutputInterface::class)->getMock();
+ $output
+ ->method('getFormatter')
+ ->willReturn(new OutputFormatter());
+
+ $style = new SymfonyStyle($this->getMockBuilder(InputInterface::class)->getMock(), $output);
- $ref = new \ReflectionProperty(get_parent_class($this), 'lineLength');
- $ref->setAccessible(true);
- $ref->setValue($this, 120);
+ $this->assertInstanceOf(SymfonyStyle::class, $style->getErrorStyle());
}
}
diff --git a/vendor/symfony/console/Tests/TerminalTest.php b/vendor/symfony/console/Tests/TerminalTest.php
new file mode 100644
index 00000000..91af1d0a
--- /dev/null
+++ b/vendor/symfony/console/Tests/TerminalTest.php
@@ -0,0 +1,44 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests;
+
+use PHPUnit\Framework\TestCase;
+use Symfony\Component\Console\Terminal;
+
+class TerminalTest extends TestCase
+{
+ public function test()
+ {
+ putenv('COLUMNS=100');
+ putenv('LINES=50');
+ $terminal = new Terminal();
+ $this->assertSame(100, $terminal->getWidth());
+ $this->assertSame(50, $terminal->getHeight());
+
+ putenv('COLUMNS=120');
+ putenv('LINES=60');
+ $terminal = new Terminal();
+ $this->assertSame(120, $terminal->getWidth());
+ $this->assertSame(60, $terminal->getHeight());
+ }
+
+ public function test_zero_values()
+ {
+ putenv('COLUMNS=0');
+ putenv('LINES=0');
+
+ $terminal = new Terminal();
+
+ $this->assertSame(0, $terminal->getWidth());
+ $this->assertSame(0, $terminal->getHeight());
+ }
+}
diff --git a/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php b/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php
index a8389dd1..57e7136d 100644
--- a/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php
+++ b/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php
@@ -11,11 +11,12 @@
namespace Symfony\Component\Console\Tests\Tester;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Output\Output;
use Symfony\Component\Console\Tester\ApplicationTester;
-class ApplicationTesterTest extends \PHPUnit_Framework_TestCase
+class ApplicationTesterTest extends TestCase
{
protected $application;
protected $tester;
diff --git a/vendor/symfony/console/Tests/Tester/CommandTesterTest.php b/vendor/symfony/console/Tests/Tester/CommandTesterTest.php
index b54c00e8..8d86da43 100644
--- a/vendor/symfony/console/Tests/Tester/CommandTesterTest.php
+++ b/vendor/symfony/console/Tests/Tester/CommandTesterTest.php
@@ -11,12 +11,17 @@
namespace Symfony\Component\Console\Tests\Tester;
+use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Output\Output;
use Symfony\Component\Console\Tester\CommandTester;
+use Symfony\Component\Console\Question\Question;
+use Symfony\Component\Console\Helper\HelperSet;
+use Symfony\Component\Console\Helper\QuestionHelper;
+use Symfony\Component\Console\Style\SymfonyStyle;
-class CommandTesterTest extends \PHPUnit_Framework_TestCase
+class CommandTesterTest extends TestCase
{
protected $command;
protected $tester;
@@ -81,4 +86,78 @@ class CommandTesterTest extends \PHPUnit_Framework_TestCase
// check that there is no need to pass the command name here
$this->assertEquals(0, $tester->execute(array()));
}
+
+ public function testCommandWithInputs()
+ {
+ $questions = array(
+ 'What\'s your name?',
+ 'How are you?',
+ 'Where do you come from?',
+ );
+
+ $command = new Command('foo');
+ $command->setHelperSet(new HelperSet(array(new QuestionHelper())));
+ $command->setCode(function ($input, $output) use ($questions, $command) {
+ $helper = $command->getHelper('question');
+ $helper->ask($input, $output, new Question($questions[0]));
+ $helper->ask($input, $output, new Question($questions[1]));
+ $helper->ask($input, $output, new Question($questions[2]));
+ });
+
+ $tester = new CommandTester($command);
+ $tester->setInputs(array('Bobby', 'Fine', 'France'));
+ $tester->execute(array());
+
+ $this->assertEquals(0, $tester->getStatusCode());
+ $this->assertEquals(implode('', $questions), $tester->getDisplay(true));
+ }
+
+ /**
+ * @expectedException \RuntimeException
+ * @expectedMessage Aborted
+ */
+ public function testCommandWithWrongInputsNumber()
+ {
+ $questions = array(
+ 'What\'s your name?',
+ 'How are you?',
+ 'Where do you come from?',
+ );
+
+ $command = new Command('foo');
+ $command->setHelperSet(new HelperSet(array(new QuestionHelper())));
+ $command->setCode(function ($input, $output) use ($questions, $command) {
+ $helper = $command->getHelper('question');
+ $helper->ask($input, $output, new Question($questions[0]));
+ $helper->ask($input, $output, new Question($questions[1]));
+ $helper->ask($input, $output, new Question($questions[2]));
+ });
+
+ $tester = new CommandTester($command);
+ $tester->setInputs(array('Bobby', 'Fine'));
+ $tester->execute(array());
+ }
+
+ public function testSymfonyStyleCommandWithInputs()
+ {
+ $questions = array(
+ 'What\'s your name?',
+ 'How are you?',
+ 'Where do you come from?',
+ );
+
+ $command = new Command('foo');
+ $command->setCode(function ($input, $output) use ($questions, $command) {
+ $io = new SymfonyStyle($input, $output);
+ $io->ask($questions[0]);
+ $io->ask($questions[1]);
+ $io->ask($questions[2]);
+ });
+
+ $tester = new CommandTester($command);
+ $tester->setInputs(array('Bobby', 'Fine', 'France'));
+ $tester->execute(array());
+
+ $this->assertEquals(0, $tester->getStatusCode());
+ }
}