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.php1146
-rw-r--r--vendor/symfony/console/Tests/Command/CommandTest.php395
-rw-r--r--vendor/symfony/console/Tests/Command/HelpCommandTest.php70
-rw-r--r--vendor/symfony/console/Tests/Command/ListCommandTest.php112
-rw-r--r--vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php106
-rw-r--r--vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php35
-rw-r--r--vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.php27
-rw-r--r--vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php77
-rw-r--r--vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php27
-rw-r--r--vendor/symfony/console/Tests/Descriptor/XmlDescriptorTest.php27
-rw-r--r--vendor/symfony/console/Tests/Fixtures/BarBucCommand.php11
-rw-r--r--vendor/symfony/console/Tests/Fixtures/DescriptorApplication1.php18
-rw-r--r--vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.php24
-rw-r--r--vendor/symfony/console/Tests/Fixtures/DescriptorCommand1.php27
-rw-r--r--vendor/symfony/console/Tests/Fixtures/DescriptorCommand2.php32
-rw-r--r--vendor/symfony/console/Tests/Fixtures/DummyOutput.php36
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Foo1Command.php26
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Foo2Command.php21
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Foo3Command.php29
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Foo4Command.php11
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Foo5Command.php10
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Foo6Command.php12
-rw-r--r--vendor/symfony/console/Tests/Fixtures/FooCommand.php33
-rw-r--r--vendor/symfony/console/Tests/Fixtures/FooSubnamespaced1Command.php26
-rw-r--r--vendor/symfony/console/Tests/Fixtures/FooSubnamespaced2Command.php26
-rw-r--r--vendor/symfony/console/Tests/Fixtures/FoobarCommand.php25
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_0.php11
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_1.php13
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_10.php17
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php13
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php16
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_3.php12
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4.php34
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php37
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_6.php16
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_7.php15
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_8.php26
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_9.php11
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_0.txt3
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_1.txt9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_10.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_2.txt13
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_3.txt7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_4.txt32
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_5.txt18
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_6.txt6
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_7.txt5
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_8.txt9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_9.txt5
-rw-r--r--vendor/symfony/console/Tests/Fixtures/TestCommand.php28
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_1.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_1.md201
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_1.txt17
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_1.xml110
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_2.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_2.md396
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_2.txt22
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_2.xml190
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_astext1.txt20
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_astext2.txt16
-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_gethelp.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt6
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt8
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt18
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt18
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1.txt8
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt8
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_run1.txt17
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_run2.txt29
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_run3.txt27
-rw-r--r--vendor/symfony/console/Tests/Fixtures/application_run4.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_1.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_1.md11
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_1.txt7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_1.xml12
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_2.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_2.md33
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_2.txt13
-rw-r--r--vendor/symfony/console/Tests/Fixtures/command_2.xml21
-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/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.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_1.md7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_1.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_1.xml5
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_2.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_2.md7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_2.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_2.xml5
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_3.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_3.md7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_3.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_3.xml7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_argument_4.json1
-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_4.xml6
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_1.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_1.md0
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_1.txt0
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_1.xml5
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_2.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_2.md9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_2.txt2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_2.xml10
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_3.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_3.md11
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_3.txt2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_3.xml9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_4.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_4.md21
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_4.txt5
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_definition_4.xml14
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_1.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_1.md9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_1.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_1.xml4
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_2.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_2.md9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_2.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_2.xml7
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_3.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_3.md9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_3.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_3.xml5
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_4.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_4.md9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_4.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_4.xml5
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_5.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_5.md10
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_5.txt2
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_5.xml6
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_6.json1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_6.md9
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_6.txt1
-rw-r--r--vendor/symfony/console/Tests/Fixtures/input_option_6.xml5
-rw-r--r--vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php70
-rw-r--r--vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php99
-rw-r--r--vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php273
-rw-r--r--vendor/symfony/console/Tests/Helper/FormatterHelperTest.php92
-rw-r--r--vendor/symfony/console/Tests/Helper/HelperSetTest.php133
-rw-r--r--vendor/symfony/console/Tests/Helper/HelperTest.php54
-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.php117
-rw-r--r--vendor/symfony/console/Tests/Helper/ProgressBarTest.php664
-rw-r--r--vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php182
-rw-r--r--vendor/symfony/console/Tests/Helper/QuestionHelperTest.php435
-rw-r--r--vendor/symfony/console/Tests/Helper/TableStyleTest.php27
-rw-r--r--vendor/symfony/console/Tests/Helper/TableTest.php645
-rw-r--r--vendor/symfony/console/Tests/Input/ArgvInputTest.php317
-rw-r--r--vendor/symfony/console/Tests/Input/ArrayInputTest.php138
-rw-r--r--vendor/symfony/console/Tests/Input/InputArgumentTest.php111
-rw-r--r--vendor/symfony/console/Tests/Input/InputDefinitionTest.php437
-rw-r--r--vendor/symfony/console/Tests/Input/InputOptionTest.php204
-rw-r--r--vendor/symfony/console/Tests/Input/InputTest.php132
-rw-r--r--vendor/symfony/console/Tests/Input/StringInputTest.php99
-rw-r--r--vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php58
-rw-r--r--vendor/symfony/console/Tests/Output/ConsoleOutputTest.php25
-rw-r--r--vendor/symfony/console/Tests/Output/NullOutputTest.php39
-rw-r--r--vendor/symfony/console/Tests/Output/OutputTest.php175
-rw-r--r--vendor/symfony/console/Tests/Output/StreamOutputTest.php60
-rw-r--r--vendor/symfony/console/Tests/Style/SymfonyStyleTest.php89
-rw-r--r--vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php69
-rw-r--r--vendor/symfony/console/Tests/Tester/CommandTesterTest.php84
174 files changed, 10161 insertions, 0 deletions
diff --git a/vendor/symfony/console/Tests/ApplicationTest.php b/vendor/symfony/console/Tests/ApplicationTest.php
new file mode 100644
index 00000000..927fa0bd
--- /dev/null
+++ b/vendor/symfony/console/Tests/ApplicationTest.php
@@ -0,0 +1,1146 @@
+<?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 Symfony\Component\Console\Application;
+use Symfony\Component\Console\Helper\HelperSet;
+use Symfony\Component\Console\Helper\FormatterHelper;
+use Symfony\Component\Console\Input\ArgvInput;
+use Symfony\Component\Console\Input\ArrayInput;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\NullOutput;
+use Symfony\Component\Console\Output\Output;
+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\ConsoleExceptionEvent;
+use Symfony\Component\Console\Event\ConsoleTerminateEvent;
+use Symfony\Component\EventDispatcher\EventDispatcher;
+
+class ApplicationTest extends \PHPUnit_Framework_TestCase
+{
+ protected static $fixturesPath;
+
+ public static function setUpBeforeClass()
+ {
+ self::$fixturesPath = realpath(__DIR__.'/Fixtures/');
+ require_once self::$fixturesPath.'/FooCommand.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.'/FoobarCommand.php';
+ require_once self::$fixturesPath.'/BarBucCommand.php';
+ require_once self::$fixturesPath.'/FooSubnamespaced1Command.php';
+ require_once self::$fixturesPath.'/FooSubnamespaced2Command.php';
+ }
+
+ protected function normalizeLineBreaks($text)
+ {
+ return str_replace(PHP_EOL, "\n", $text);
+ }
+
+ /**
+ * Replaces the dynamic placeholders of the command help text with a static version.
+ * The placeholder %command.full_name% includes the script path that is not predictable
+ * and can not be tested against.
+ */
+ protected function ensureStaticCommandHelp(Application $application)
+ {
+ foreach ($application->all() as $command) {
+ $command->setHelp(str_replace('%command.full_name%', 'app/console %command.name%', $command->getHelp()));
+ }
+ }
+
+ public function testConstructor()
+ {
+ $application = new Application('foo', 'bar');
+ $this->assertEquals('foo', $application->getName(), '__construct() takes the application name as its first argument');
+ $this->assertEquals('bar', $application->getVersion(), '__construct() takes the application version as its second argument');
+ $this->assertEquals(array('help', 'list'), array_keys($application->all()), '__construct() registered the help and list commands by default');
+ }
+
+ public function testSetGetName()
+ {
+ $application = new Application();
+ $application->setName('foo');
+ $this->assertEquals('foo', $application->getName(), '->setName() sets the name of the application');
+ }
+
+ public function testSetGetVersion()
+ {
+ $application = new Application();
+ $application->setVersion('bar');
+ $this->assertEquals('bar', $application->getVersion(), '->setVersion() sets the version of the application');
+ }
+
+ 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');
+ }
+
+ public function testHelp()
+ {
+ $application = new Application();
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_gethelp.txt', $this->normalizeLineBreaks($application->getHelp()), '->getHelp() returns a help message');
+ }
+
+ public function testAll()
+ {
+ $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');
+ }
+
+ public function testRegister()
+ {
+ $application = new Application();
+ $command = $application->register('foo');
+ $this->assertEquals('foo', $command->getName(), '->register() registers a new command');
+ }
+
+ public function testAdd()
+ {
+ $application = new Application();
+ $application->add($foo = new \FooCommand());
+ $commands = $application->all();
+ $this->assertEquals($foo, $commands['foo:bar'], '->add() registers a command');
+
+ $application = new Application();
+ $application->addCommands(array($foo = new \FooCommand(), $foo1 = new \Foo1Command()));
+ $commands = $application->all();
+ $this->assertEquals(array($foo, $foo1), array($commands['foo:bar'], $commands['foo:bar1']), '->addCommands() registers an array of commands');
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage Command class "Foo5Command" is not correctly initialized. You probably forgot to call the parent constructor.
+ */
+ public function testAddCommandWithEmptyConstructor()
+ {
+ $application = new Application();
+ $application->add(new \Foo5Command());
+ }
+
+ public function testHasGet()
+ {
+ $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 = new Application();
+ $application->add($foo = new \FooCommand());
+ // simulate --help
+ $r = new \ReflectionObject($application);
+ $p = $r->getProperty('wantHelps');
+ $p->setAccessible(true);
+ $p->setValue($application, true);
+ $command = $application->get('foo:bar');
+ $this->assertInstanceOf('Symfony\Component\Console\Command\HelpCommand', $command, '->get() returns the help command if --help is provided as the input');
+ }
+
+ public function testSilentHelp()
+ {
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+
+ $tester = new ApplicationTester($application);
+ $tester->run(array('-h' => true, '-q' => true), array('decorated' => false));
+
+ $this->assertEmpty($tester->getDisplay(true));
+ }
+
+ /**
+ * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException
+ * @expectedExceptionMessage The command "foofoo" does not exist.
+ */
+ public function testGetInvalidCommand()
+ {
+ $application = new Application();
+ $application->get('foofoo');
+ }
+
+ public function testGetNamespaces()
+ {
+ $application = new Application();
+ $application->add(new \FooCommand());
+ $application->add(new \Foo1Command());
+ $this->assertEquals(array('foo'), $application->getNamespaces(), '->getNamespaces() returns an array of unique used namespaces');
+ }
+
+ public function testFindNamespace()
+ {
+ $application = new Application();
+ $application->add(new \FooCommand());
+ $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists');
+ $this->assertEquals('foo', $application->findNamespace('f'), '->findNamespace() finds a namespace given an abbreviation');
+ $application->add(new \Foo2Command());
+ $this->assertEquals('foo', $application->findNamespace('foo'), '->findNamespace() returns the given namespace if it exists');
+ }
+
+ public function testFindNamespaceWithSubnamespaces()
+ {
+ $application = new Application();
+ $application->add(new \FooSubnamespaced1Command());
+ $application->add(new \FooSubnamespaced2Command());
+ $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());
+ $application->findNamespace('f');
+ }
+
+ /**
+ * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException
+ * @expectedExceptionMessage There are no commands defined in the "bar" namespace.
+ */
+ public function testFindInvalidNamespace()
+ {
+ $application = new Application();
+ $application->findNamespace('bar');
+ }
+
+ /**
+ * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException
+ * @expectedExceptionMessage Command "foo1" is not defined
+ */
+ public function testFindUniqueNameButNamespaceName()
+ {
+ $application = new Application();
+ $application->add(new \FooCommand());
+ $application->add(new \Foo1Command());
+ $application->add(new \Foo2Command());
+
+ $application->find($commandName = 'foo1');
+ }
+
+ public function testFind()
+ {
+ $application = new Application();
+ $application->add(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);
+
+ $application = new Application();
+ $application->add(new \FooCommand());
+ $application->add(new \Foo1Command());
+ $application->add(new \Foo2Command());
+
+ $application->find($abbreviation);
+ }
+
+ public function provideAmbiguousAbbreviations()
+ {
+ 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).'),
+ );
+ }
+
+ public function testFindCommandEqualNamespace()
+ {
+ $application = new Application();
+ $application->add(new \Foo3Command());
+ $application->add(new \Foo4Command());
+
+ $this->assertInstanceOf('Foo3Command', $application->find('foo3:bar'), '->find() returns the good command even if a namespace has same name');
+ $this->assertInstanceOf('Foo4Command', $application->find('foo3:bar:toh'), '->find() returns a command even if its namespace equals another command name');
+ }
+
+ public function testFindCommandWithAmbiguousNamespacesButUniqueName()
+ {
+ $application = new Application();
+ $application->add(new \FooCommand());
+ $application->add(new \FoobarCommand());
+
+ $this->assertInstanceOf('FoobarCommand', $application->find('f:f'));
+ }
+
+ public function testFindCommandWithMissingNamespace()
+ {
+ $application = new Application();
+ $application->add(new \Foo4Command());
+
+ $this->assertInstanceOf('Foo4Command', $application->find('f::t'));
+ }
+
+ /**
+ * @dataProvider provideInvalidCommandNamesSingle
+ * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException
+ * @expectedExceptionMessage Did you mean this
+ */
+ public function testFindAlternativeExceptionMessageSingle($name)
+ {
+ $application = new Application();
+ $application->add(new \Foo3Command());
+ $application->find($name);
+ }
+
+ public function provideInvalidCommandNamesSingle()
+ {
+ return array(
+ array('foo3:baR'),
+ array('foO3:bar'),
+ );
+ }
+
+ public function testFindAlternativeExceptionMessageMultiple()
+ {
+ $application = new Application();
+ $application->add(new \FooCommand());
+ $application->add(new \Foo1Command());
+ $application->add(new \Foo2Command());
+
+ // Command + plural
+ try {
+ $application->find('foo:baR');
+ $this->fail('->find() throws a CommandNotFoundException if command does not exist, with alternatives');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
+ $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
+ $this->assertRegExp('/foo1:bar/', $e->getMessage());
+ $this->assertRegExp('/foo:bar/', $e->getMessage());
+ }
+
+ // Namespace + plural
+ try {
+ $application->find('foo2:bar');
+ $this->fail('->find() throws a CommandNotFoundException if command does not exist, with alternatives');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
+ $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
+ $this->assertRegExp('/foo1/', $e->getMessage());
+ }
+
+ $application->add(new \Foo3Command());
+ $application->add(new \Foo4Command());
+
+ // Subnamespace + plural
+ try {
+ $a = $application->find('foo3:');
+ $this->fail('->find() should throw an Symfony\Component\Console\Exception\CommandNotFoundException if a command is ambiguous because of a subnamespace, with alternatives');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e);
+ $this->assertRegExp('/foo3:bar/', $e->getMessage());
+ $this->assertRegExp('/foo3:bar:toh/', $e->getMessage());
+ }
+ }
+
+ public function testFindAlternativeCommands()
+ {
+ $application = new Application();
+
+ $application->add(new \FooCommand());
+ $application->add(new \Foo1Command());
+ $application->add(new \Foo2Command());
+
+ try {
+ $application->find($commandName = 'Unknown command');
+ $this->fail('->find() throws a CommandNotFoundException if command does not exist');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist');
+ $this->assertSame(array(), $e->getAlternatives());
+ $this->assertEquals(sprintf('Command "%s" is not defined.', $commandName), $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, without alternatives');
+ }
+
+ // Test if "bar1" command throw a "CommandNotFoundException" and does not contain
+ // "foo:bar" as alternative because "bar1" is too far from "foo:bar"
+ try {
+ $application->find($commandName = 'bar1');
+ $this->fail('->find() throws a CommandNotFoundException if command does not exist');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist');
+ $this->assertSame(array('afoobar1', 'foo:bar1'), $e->getAlternatives());
+ $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
+ $this->assertRegExp('/afoobar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "afoobar1"');
+ $this->assertRegExp('/foo:bar1/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternative : "foo:bar1"');
+ $this->assertNotRegExp('/foo:bar(?>!1)/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, without "foo:bar" alternative');
+ }
+ }
+
+ public function testFindAlternativeCommandsWithAnAlias()
+ {
+ $fooCommand = new \FooCommand();
+ $fooCommand->setAliases(array('foo2'));
+
+ $application = new Application();
+ $application->add($fooCommand);
+
+ $result = $application->find('foo');
+
+ $this->assertSame($fooCommand, $result);
+ }
+
+ public function testFindAlternativeNamespace()
+ {
+ $application = new Application();
+
+ $application->add(new \FooCommand());
+ $application->add(new \Foo1Command());
+ $application->add(new \Foo2Command());
+ $application->add(new \foo3Command());
+
+ try {
+ $application->find('Unknown-namespace:Unknown-command');
+ $this->fail('->find() throws a CommandNotFoundException if namespace does not exist');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if namespace does not exist');
+ $this->assertSame(array(), $e->getAlternatives());
+ $this->assertEquals('There are no commands defined in the "Unknown-namespace" namespace.', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, without alternatives');
+ }
+
+ try {
+ $application->find('foo2:command');
+ $this->fail('->find() throws a CommandNotFoundException if namespace does not exist');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if namespace does not exist');
+ $this->assertCount(3, $e->getAlternatives());
+ $this->assertContains('foo', $e->getAlternatives());
+ $this->assertContains('foo1', $e->getAlternatives());
+ $this->assertContains('foo3', $e->getAlternatives());
+ $this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative');
+ $this->assertRegExp('/foo/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo"');
+ $this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo1"');
+ $this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo3"');
+ }
+ }
+
+ public function testFindNamespaceDoesNotFailOnDeepSimilarNamespaces()
+ {
+ $application = $this->getMock('Symfony\Component\Console\Application', array('getNamespaces'));
+ $application->expects($this->once())
+ ->method('getNamespaces')
+ ->will($this->returnValue(array('foo:sublong', 'bar:sub')));
+
+ $this->assertEquals('foo:sublong', $application->findNamespace('f:sub'));
+ }
+
+ /**
+ * @expectedException Symfony\Component\Console\Exception\CommandNotFoundException
+ * @expectedExceptionMessage Command "foo::bar" is not defined.
+ */
+ public function testFindWithDoubleColonInNameThrowsException()
+ {
+ $application = new Application();
+ $application->add(new \FooCommand());
+ $application->add(new \Foo4Command());
+ $application->find('foo::bar');
+ }
+
+ public function testSetCatchExceptions()
+ {
+ $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
+ $application->setAutoExit(false);
+ $application->expects($this->any())
+ ->method('getTerminalWidth')
+ ->will($this->returnValue(120));
+ $tester = new ApplicationTester($application);
+
+ $application->setCatchExceptions(true);
+ $tester->run(array('command' => 'foo'), array('decorated' => false));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception1.txt', $tester->getDisplay(true), '->setCatchExceptions() sets the catch exception flag');
+
+ $application->setCatchExceptions(false);
+ try {
+ $tester->run(array('command' => 'foo'), array('decorated' => false));
+ $this->fail('->setCatchExceptions() sets the catch exception flag');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('\Exception', $e, '->setCatchExceptions() sets the catch exception flag');
+ $this->assertEquals('Command "foo" is not defined.', $e->getMessage(), '->setCatchExceptions() sets the catch exception flag');
+ }
+ }
+
+ /**
+ * @group legacy
+ */
+ public function testLegacyAsText()
+ {
+ $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');
+ }
+
+ /**
+ * @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');
+ }
+
+ public function testRenderException()
+ {
+ $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
+ $application->setAutoExit(false);
+ $application->expects($this->any())
+ ->method('getTerminalWidth')
+ ->will($this->returnValue(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, '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' => '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');
+
+ $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' => 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'));
+ $application->setAutoExit(false);
+ $application->expects($this->any())
+ ->method('getTerminalWidth')
+ ->will($this->returnValue(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');
+ }
+
+ public function testRenderExceptionWithDoubleWidthCharacters()
+ {
+ $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
+ $application->setAutoExit(false);
+ $application->expects($this->any())
+ ->method('getTerminalWidth')
+ ->will($this->returnValue(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' => true));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth1decorated.txt', $tester->getDisplay(true), '->renderException() renders a pretty exceptions with previous exceptions');
+
+ $application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
+ $application->setAutoExit(false);
+ $application->expects($this->any())
+ ->method('getTerminalWidth')
+ ->will($this->returnValue(32));
+ $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_doublewidth2.txt', $tester->getDisplay(true), '->renderException() wraps messages when they are bigger than the terminal');
+ }
+
+ public function testRun()
+ {
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+ $application->add($command = new \Foo1Command());
+ $_SERVER['argv'] = array('cli.php', 'foo:bar1');
+
+ ob_start();
+ $application->run();
+ ob_end_clean();
+
+ $this->assertInstanceOf('Symfony\Component\Console\Input\ArgvInput', $command->input, '->run() creates an ArgvInput by default if none is given');
+ $this->assertInstanceOf('Symfony\Component\Console\Output\ConsoleOutput', $command->output, '->run() creates a ConsoleOutput by default if none is given');
+
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+
+ $this->ensureStaticCommandHelp($application);
+ $tester = new ApplicationTester($application);
+
+ $tester->run(array(), array('decorated' => false));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_run1.txt', $tester->getDisplay(true), '->run() runs the list command if no argument is passed');
+
+ $tester->run(array('--help' => true), array('decorated' => false));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $tester->getDisplay(true), '->run() runs the help command if --help is passed');
+
+ $tester->run(array('-h' => true), array('decorated' => false));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_run2.txt', $tester->getDisplay(true), '->run() runs the help command if -h is passed');
+
+ $tester->run(array('command' => 'list', '--help' => true), array('decorated' => false));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $tester->getDisplay(true), '->run() displays the help if --help is passed');
+
+ $tester->run(array('command' => 'list', '-h' => true), array('decorated' => false));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_run3.txt', $tester->getDisplay(true), '->run() displays the help if -h is passed');
+
+ $tester->run(array('--ansi' => true));
+ $this->assertTrue($tester->getOutput()->isDecorated(), '->run() forces color output if --ansi is passed');
+
+ $tester->run(array('--no-ansi' => true));
+ $this->assertFalse($tester->getOutput()->isDecorated(), '->run() forces color output to be disabled if --no-ansi is passed');
+
+ $tester->run(array('--version' => true), array('decorated' => false));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $tester->getDisplay(true), '->run() displays the program version if --version is passed');
+
+ $tester->run(array('-V' => true), array('decorated' => false));
+ $this->assertStringEqualsFile(self::$fixturesPath.'/application_run4.txt', $tester->getDisplay(true), '->run() displays the program version if -v is passed');
+
+ $tester->run(array('command' => 'list', '--quiet' => true));
+ $this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed');
+
+ $tester->run(array('command' => 'list', '-q' => true));
+ $this->assertSame('', $tester->getDisplay(), '->run() removes all output 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');
+
+ $tester->run(array('command' => 'list', '--verbose' => 1));
+ $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose=1 is passed');
+
+ $tester->run(array('command' => 'list', '--verbose' => 2));
+ $this->assertSame(Output::VERBOSITY_VERY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to very verbose if --verbose=2 is passed');
+
+ $tester->run(array('command' => 'list', '--verbose' => 3));
+ $this->assertSame(Output::VERBOSITY_DEBUG, $tester->getOutput()->getVerbosity(), '->run() sets the output to debug if --verbose=3 is passed');
+
+ $tester->run(array('command' => 'list', '--verbose' => 4));
+ $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if unknown --verbose level is passed');
+
+ $tester->run(array('command' => 'list', '-v' => true));
+ $this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed');
+
+ $tester->run(array('command' => 'list', '-vv' => true));
+ $this->assertSame(Output::VERBOSITY_VERY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed');
+
+ $tester->run(array('command' => 'list', '-vvv' => true));
+ $this->assertSame(Output::VERBOSITY_DEBUG, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if -v is passed');
+
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+ $application->add(new \FooCommand());
+ $tester = new ApplicationTester($application);
+
+ $tester->run(array('command' => 'foo:bar', '--no-interaction' => true), array('decorated' => false));
+ $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if --no-interaction is passed');
+
+ $tester->run(array('command' => 'foo:bar', '-n' => true), array('decorated' => false));
+ $this->assertSame('called'.PHP_EOL, $tester->getDisplay(), '->run() does not call interact() if -n is passed');
+ }
+
+ /**
+ * Issue #9285.
+ *
+ * If the "verbose" option is just before an argument in ArgvInput,
+ * an argument value should not be treated as verbosity value.
+ * This test will fail with "Not enough arguments." if broken
+ */
+ public function testVerboseValueNotBreakArguments()
+ {
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+ $application->add(new \FooCommand());
+
+ $output = new StreamOutput(fopen('php://memory', 'w', false));
+
+ $input = new ArgvInput(array('cli.php', '-v', 'foo:bar'));
+ $application->run($input, $output);
+
+ $input = new ArgvInput(array('cli.php', '--verbose', 'foo:bar'));
+ $application->run($input, $output);
+ }
+
+ public function testRunReturnsIntegerExitCode()
+ {
+ $exception = new \Exception('', 4);
+
+ $application = $this->getMock('Symfony\Component\Console\Application', array('doRun'));
+ $application->setAutoExit(false);
+ $application->expects($this->once())
+ ->method('doRun')
+ ->will($this->throwException($exception));
+
+ $exitCode = $application->run(new ArrayInput(array()), new NullOutput());
+
+ $this->assertSame(4, $exitCode, '->run() returns integer exit code extracted from raised exception');
+ }
+
+ public function testRunReturnsExitCodeOneForExceptionCodeZero()
+ {
+ $exception = new \Exception('', 0);
+
+ $application = $this->getMock('Symfony\Component\Console\Application', array('doRun'));
+ $application->setAutoExit(false);
+ $application->expects($this->once())
+ ->method('doRun')
+ ->will($this->throwException($exception));
+
+ $exitCode = $application->run(new ArrayInput(array()), new NullOutput());
+
+ $this->assertSame(1, $exitCode, '->run() returns exit code 1 when exception code is 0');
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage An option with shortcut "e" already exists.
+ */
+ public function testAddingOptionWithDuplicateShortcut()
+ {
+ $dispatcher = new EventDispatcher();
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+ $application->setDispatcher($dispatcher);
+
+ $application->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'Environment'));
+
+ $application
+ ->register('foo')
+ ->setAliases(array('f'))
+ ->setDefinition(array(new InputOption('survey', 'e', InputOption::VALUE_REQUIRED, 'My option with a shortcut.')))
+ ->setCode(function (InputInterface $input, OutputInterface $output) {})
+ ;
+
+ $input = new ArrayInput(array('command' => 'foo'));
+ $output = new NullOutput();
+
+ $application->run($input, $output);
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @dataProvider getAddingAlreadySetDefinitionElementData
+ */
+ public function testAddingAlreadySetDefinitionElementData($def)
+ {
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+ $application
+ ->register('foo')
+ ->setDefinition(array($def))
+ ->setCode(function (InputInterface $input, OutputInterface $output) {})
+ ;
+
+ $input = new ArrayInput(array('command' => 'foo'));
+ $output = new NullOutput();
+ $application->run($input, $output);
+ }
+
+ public function getAddingAlreadySetDefinitionElementData()
+ {
+ return array(
+ array(new InputArgument('command', InputArgument::REQUIRED)),
+ array(new InputOption('quiet', '', InputOption::VALUE_NONE)),
+ array(new InputOption('query', 'q', InputOption::VALUE_NONE)),
+ );
+ }
+
+ public function testGetDefaultHelperSetReturnsDefaultValues()
+ {
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+
+ $helperSet = $application->getHelperSet();
+
+ $this->assertTrue($helperSet->has('formatter'));
+ $this->assertTrue($helperSet->has('dialog'));
+ $this->assertTrue($helperSet->has('progress'));
+ }
+
+ public function testAddingSingleHelperSetOverwritesDefaultValues()
+ {
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+
+ $application->setHelperSet(new HelperSet(array(new FormatterHelper())));
+
+ $helperSet = $application->getHelperSet();
+
+ $this->assertTrue($helperSet->has('formatter'));
+
+ // no other default helper set should be returned
+ $this->assertFalse($helperSet->has('dialog'));
+ $this->assertFalse($helperSet->has('progress'));
+ }
+
+ public function testOverwritingDefaultHelperSetOverwritesDefaultValues()
+ {
+ $application = new CustomApplication();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+
+ $application->setHelperSet(new HelperSet(array(new FormatterHelper())));
+
+ $helperSet = $application->getHelperSet();
+
+ $this->assertTrue($helperSet->has('formatter'));
+
+ // no other default helper set should be returned
+ $this->assertFalse($helperSet->has('dialog'));
+ $this->assertFalse($helperSet->has('progress'));
+ }
+
+ public function testGetDefaultInputDefinitionReturnsDefaultValues()
+ {
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+
+ $inputDefinition = $application->getDefinition();
+
+ $this->assertTrue($inputDefinition->hasArgument('command'));
+
+ $this->assertTrue($inputDefinition->hasOption('help'));
+ $this->assertTrue($inputDefinition->hasOption('quiet'));
+ $this->assertTrue($inputDefinition->hasOption('verbose'));
+ $this->assertTrue($inputDefinition->hasOption('version'));
+ $this->assertTrue($inputDefinition->hasOption('ansi'));
+ $this->assertTrue($inputDefinition->hasOption('no-ansi'));
+ $this->assertTrue($inputDefinition->hasOption('no-interaction'));
+ }
+
+ public function testOverwritingDefaultInputDefinitionOverwritesDefaultValues()
+ {
+ $application = new CustomApplication();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+
+ $inputDefinition = $application->getDefinition();
+
+ // check whether the default arguments and options are not returned any more
+ $this->assertFalse($inputDefinition->hasArgument('command'));
+
+ $this->assertFalse($inputDefinition->hasOption('help'));
+ $this->assertFalse($inputDefinition->hasOption('quiet'));
+ $this->assertFalse($inputDefinition->hasOption('verbose'));
+ $this->assertFalse($inputDefinition->hasOption('version'));
+ $this->assertFalse($inputDefinition->hasOption('ansi'));
+ $this->assertFalse($inputDefinition->hasOption('no-ansi'));
+ $this->assertFalse($inputDefinition->hasOption('no-interaction'));
+
+ $this->assertTrue($inputDefinition->hasOption('custom'));
+ }
+
+ public function testSettingCustomInputDefinitionOverwritesDefaultValues()
+ {
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+
+ $application->setDefinition(new InputDefinition(array(new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.'))));
+
+ $inputDefinition = $application->getDefinition();
+
+ // check whether the default arguments and options are not returned any more
+ $this->assertFalse($inputDefinition->hasArgument('command'));
+
+ $this->assertFalse($inputDefinition->hasOption('help'));
+ $this->assertFalse($inputDefinition->hasOption('quiet'));
+ $this->assertFalse($inputDefinition->hasOption('verbose'));
+ $this->assertFalse($inputDefinition->hasOption('version'));
+ $this->assertFalse($inputDefinition->hasOption('ansi'));
+ $this->assertFalse($inputDefinition->hasOption('no-ansi'));
+ $this->assertFalse($inputDefinition->hasOption('no-interaction'));
+
+ $this->assertTrue($inputDefinition->hasOption('custom'));
+ }
+
+ public function testRunWithDispatcher()
+ {
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->setDispatcher($this->getDispatcher());
+
+ $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
+ $output->write('foo.');
+ });
+
+ $tester = new ApplicationTester($application);
+ $tester->run(array('command' => 'foo'));
+ $this->assertEquals('before.foo.after.'.PHP_EOL, $tester->getDisplay());
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage caught
+ */
+ public function testRunWithExceptionAndDispatcher()
+ {
+ $application = new Application();
+ $application->setDispatcher($this->getDispatcher());
+ $application->setAutoExit(false);
+ $application->setCatchExceptions(false);
+
+ $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
+ throw new \RuntimeException('foo');
+ });
+
+ $tester = new ApplicationTester($application);
+ $tester->run(array('command' => 'foo'));
+ }
+
+ public function testRunDispatchesAllEventsWithException()
+ {
+ $application = new Application();
+ $application->setDispatcher($this->getDispatcher());
+ $application->setAutoExit(false);
+
+ $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
+ $output->write('foo.');
+
+ throw new \RuntimeException('foo');
+ });
+
+ $tester = new ApplicationTester($application);
+ $tester->run(array('command' => 'foo'));
+ $this->assertContains('before.foo.caught.after.', $tester->getDisplay());
+ }
+
+ public function testRunWithDispatcherSkippingCommand()
+ {
+ $application = new Application();
+ $application->setDispatcher($this->getDispatcher(true));
+ $application->setAutoExit(false);
+
+ $application->register('foo')->setCode(function (InputInterface $input, OutputInterface $output) {
+ $output->write('foo.');
+ });
+
+ $tester = new ApplicationTester($application);
+ $exitCode = $tester->run(array('command' => 'foo'));
+ $this->assertContains('before.after.', $tester->getDisplay());
+ $this->assertEquals(ConsoleCommandEvent::RETURN_CODE_DISABLED, $exitCode);
+ }
+
+ public function testRunWithDispatcherAccessingInputOptions()
+ {
+ $noInteractionValue = null;
+ $quietValue = null;
+
+ $dispatcher = $this->getDispatcher();
+ $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use (&$noInteractionValue, &$quietValue) {
+ $input = $event->getInput();
+
+ $noInteractionValue = $input->getOption('no-interaction');
+ $quietValue = $input->getOption('quiet');
+ });
+
+ $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', '--no-interaction' => true));
+
+ $this->assertTrue($noInteractionValue);
+ $this->assertFalse($quietValue);
+ }
+
+ public function testRunWithDispatcherAddingInputOptions()
+ {
+ $extraValue = null;
+
+ $dispatcher = $this->getDispatcher();
+ $dispatcher->addListener('console.command', function (ConsoleCommandEvent $event) use (&$extraValue) {
+ $definition = $event->getCommand()->getDefinition();
+ $input = $event->getInput();
+
+ $definition->addOption(new InputOption('extra', null, InputOption::VALUE_REQUIRED));
+ $input->bind($definition);
+
+ $extraValue = $input->getOption('extra');
+ });
+
+ $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', '--extra' => 'some test value'));
+
+ $this->assertEquals('some test value', $extraValue);
+ }
+
+ public function testTerminalDimensions()
+ {
+ $application = new Application();
+ $originalDimensions = $application->getTerminalDimensions();
+ $this->assertCount(2, $originalDimensions);
+
+ $width = 80;
+ if ($originalDimensions[0] == $width) {
+ $width = 100;
+ }
+
+ $application->setTerminalDimensions($width, 80);
+ $this->assertSame(array($width, 80), $application->getTerminalDimensions());
+ }
+
+ 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(113);
+ }
+ });
+ $dispatcher->addListener('console.exception', function (ConsoleExceptionEvent $event) {
+ $event->getOutput()->write('caught.');
+
+ $event->setException(new \LogicException('caught.', $event->getExitCode(), $event->getException()));
+ });
+
+ return $dispatcher;
+ }
+
+ public function testSetRunCustomDefaultCommand()
+ {
+ $command = new \FooCommand();
+
+ $application = new Application();
+ $application->setAutoExit(false);
+ $application->add($command);
+ $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');
+
+ $application = new CustomDefaultCommandApplication();
+ $application->setAutoExit(false);
+
+ $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');
+ }
+
+ /**
+ * @requires function posix_isatty
+ */
+ public function testCanCheckIfTerminalIsInteractive()
+ {
+ $application = new CustomDefaultCommandApplication();
+ $application->setAutoExit(false);
+
+ $tester = new ApplicationTester($application);
+ $tester->run(array('command' => 'help'));
+
+ $this->assertFalse($tester->getInput()->hasParameterOption(array('--no-interaction', '-n')));
+
+ $inputStream = $application->getHelperSet()->get('question')->getInputStream();
+ $this->assertEquals($tester->getInput()->isInteractive(), @posix_isatty($inputStream));
+ }
+}
+
+class CustomApplication extends Application
+{
+ /**
+ * Overwrites the default input definition.
+ *
+ * @return InputDefinition An InputDefinition instance
+ */
+ protected function getDefaultInputDefinition()
+ {
+ return new InputDefinition(array(new InputOption('--custom', '-c', InputOption::VALUE_NONE, 'Set the custom input definition.')));
+ }
+
+ /**
+ * Gets the default helper set with the helpers that should always be available.
+ *
+ * @return HelperSet A HelperSet instance
+ */
+ protected function getDefaultHelperSet()
+ {
+ return new HelperSet(array(new FormatterHelper()));
+ }
+}
+
+class CustomDefaultCommandApplication extends Application
+{
+ /**
+ * Overwrites the constructor in order to set a different default command.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+
+ $command = new \FooCommand();
+ $this->add($command);
+ $this->setDefaultCommand($command->getName());
+ }
+}
diff --git a/vendor/symfony/console/Tests/Command/CommandTest.php b/vendor/symfony/console/Tests/Command/CommandTest.php
new file mode 100644
index 00000000..e8836d8c
--- /dev/null
+++ b/vendor/symfony/console/Tests/Command/CommandTest.php
@@ -0,0 +1,395 @@
+<?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 Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Helper\FormatterHelper;
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\StringInput;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Output\NullOutput;
+use Symfony\Component\Console\Tester\CommandTester;
+
+class CommandTest extends \PHPUnit_Framework_TestCase
+{
+ protected static $fixturesPath;
+
+ public static function setUpBeforeClass()
+ {
+ self::$fixturesPath = __DIR__.'/../Fixtures/';
+ require_once self::$fixturesPath.'/TestCommand.php';
+ }
+
+ public function testConstructor()
+ {
+ $command = new Command('foo:bar');
+ $this->assertEquals('foo:bar', $command->getName(), '__construct() takes the command name as its first argument');
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage The command defined in "Symfony\Component\Console\Command\Command" cannot have an empty name.
+ */
+ public function testCommandNameCannotBeEmpty()
+ {
+ new Command();
+ }
+
+ public function testSetApplication()
+ {
+ $application = new Application();
+ $command = new \TestCommand();
+ $command->setApplication($application);
+ $this->assertEquals($application, $command->getApplication(), '->setApplication() sets the current application');
+ }
+
+ public function testSetGetDefinition()
+ {
+ $command = new \TestCommand();
+ $ret = $command->setDefinition($definition = new InputDefinition());
+ $this->assertEquals($command, $ret, '->setDefinition() implements a fluent interface');
+ $this->assertEquals($definition, $command->getDefinition(), '->setDefinition() sets the current InputDefinition instance');
+ $command->setDefinition(array(new InputArgument('foo'), new InputOption('bar')));
+ $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument');
+ $this->assertTrue($command->getDefinition()->hasOption('bar'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument');
+ $command->setDefinition(new InputDefinition());
+ }
+
+ public function testAddArgument()
+ {
+ $command = new \TestCommand();
+ $ret = $command->addArgument('foo');
+ $this->assertEquals($command, $ret, '->addArgument() implements a fluent interface');
+ $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->addArgument() adds an argument to the command');
+ }
+
+ public function testAddOption()
+ {
+ $command = new \TestCommand();
+ $ret = $command->addOption('foo');
+ $this->assertEquals($command, $ret, '->addOption() implements a fluent interface');
+ $this->assertTrue($command->getDefinition()->hasOption('foo'), '->addOption() adds an option to the command');
+ }
+
+ public function testGetNamespaceGetNameSetName()
+ {
+ $command = new \TestCommand();
+ $this->assertEquals('namespace:name', $command->getName(), '->getName() returns the command name');
+ $command->setName('foo');
+ $this->assertEquals('foo', $command->getName(), '->setName() sets the command name');
+
+ $ret = $command->setName('foobar:bar');
+ $this->assertEquals($command, $ret, '->setName() implements a fluent interface');
+ $this->assertEquals('foobar:bar', $command->getName(), '->setName() sets the command name');
+ }
+
+ /**
+ * @dataProvider provideInvalidCommandNames
+ */
+ public function testInvalidCommandNames($name)
+ {
+ $this->setExpectedException('InvalidArgumentException', sprintf('Command name "%s" is invalid.', $name));
+
+ $command = new \TestCommand();
+ $command->setName($name);
+ }
+
+ public function provideInvalidCommandNames()
+ {
+ return array(
+ array(''),
+ array('foo:'),
+ );
+ }
+
+ public function testGetSetDescription()
+ {
+ $command = new \TestCommand();
+ $this->assertEquals('description', $command->getDescription(), '->getDescription() returns the description');
+ $ret = $command->setDescription('description1');
+ $this->assertEquals($command, $ret, '->setDescription() implements a fluent interface');
+ $this->assertEquals('description1', $command->getDescription(), '->setDescription() sets the description');
+ }
+
+ public function testGetSetHelp()
+ {
+ $command = new \TestCommand();
+ $this->assertEquals('help', $command->getHelp(), '->getHelp() returns the help');
+ $ret = $command->setHelp('help1');
+ $this->assertEquals($command, $ret, '->setHelp() implements a fluent interface');
+ $this->assertEquals('help1', $command->getHelp(), '->setHelp() sets the help');
+ $command->setHelp('');
+ $this->assertEquals('', $command->getHelp(), '->getHelp() does not fall back to the description');
+ }
+
+ public function testGetProcessedHelp()
+ {
+ $command = new \TestCommand();
+ $command->setHelp('The %command.name% command does... Example: php %command.full_name%.');
+ $this->assertContains('The namespace:name command does...', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.name% correctly');
+ $this->assertNotContains('%command.full_name%', $command->getProcessedHelp(), '->getProcessedHelp() replaces %command.full_name%');
+
+ $command = new \TestCommand();
+ $command->setHelp('');
+ $this->assertContains('description', $command->getProcessedHelp(), '->getProcessedHelp() falls back to the description');
+ }
+
+ public function testGetSetAliases()
+ {
+ $command = new \TestCommand();
+ $this->assertEquals(array('name'), $command->getAliases(), '->getAliases() returns the aliases');
+ $ret = $command->setAliases(array('name1'));
+ $this->assertEquals($command, $ret, '->setAliases() implements a fluent interface');
+ $this->assertEquals(array('name1'), $command->getAliases(), '->setAliases() sets the aliases');
+ }
+
+ public function testGetSynopsis()
+ {
+ $command = new \TestCommand();
+ $command->addOption('foo');
+ $command->addArgument('bar');
+ $this->assertEquals('namespace:name [--foo] [--] [<bar>]', $command->getSynopsis(), '->getSynopsis() returns the synopsis');
+ }
+
+ public function testGetHelper()
+ {
+ $application = new Application();
+ $command = new \TestCommand();
+ $command->setApplication($application);
+ $formatterHelper = new FormatterHelper();
+ $this->assertEquals($formatterHelper->getName(), $command->getHelper('formatter')->getName(), '->getHelper() returns the correct helper');
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage Cannot retrieve helper "formatter" because there is no HelperSet defined.
+ */
+ public function testGetHelperWithoutHelperSet()
+ {
+ $command = new \TestCommand();
+ $command->getHelper('formatter');
+ }
+
+ public function testMergeApplicationDefinition()
+ {
+ $application1 = new Application();
+ $application1->getDefinition()->addArguments(array(new InputArgument('foo')));
+ $application1->getDefinition()->addOptions(array(new InputOption('bar')));
+ $command = new \TestCommand();
+ $command->setApplication($application1);
+ $command->setDefinition($definition = new InputDefinition(array(new InputArgument('bar'), new InputOption('foo'))));
+
+ $r = new \ReflectionObject($command);
+ $m = $r->getMethod('mergeApplicationDefinition');
+ $m->setAccessible(true);
+ $m->invoke($command);
+ $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->mergeApplicationDefinition() merges the application arguments and the command arguments');
+ $this->assertTrue($command->getDefinition()->hasArgument('bar'), '->mergeApplicationDefinition() merges the application arguments and the command arguments');
+ $this->assertTrue($command->getDefinition()->hasOption('foo'), '->mergeApplicationDefinition() merges the application options and the command options');
+ $this->assertTrue($command->getDefinition()->hasOption('bar'), '->mergeApplicationDefinition() merges the application options and the command options');
+
+ $m->invoke($command);
+ $this->assertEquals(3, $command->getDefinition()->getArgumentCount(), '->mergeApplicationDefinition() does not try to merge twice the application arguments and options');
+ }
+
+ public function testMergeApplicationDefinitionWithoutArgsThenWithArgsAddsArgs()
+ {
+ $application1 = new Application();
+ $application1->getDefinition()->addArguments(array(new InputArgument('foo')));
+ $application1->getDefinition()->addOptions(array(new InputOption('bar')));
+ $command = new \TestCommand();
+ $command->setApplication($application1);
+ $command->setDefinition($definition = new InputDefinition(array()));
+
+ $r = new \ReflectionObject($command);
+ $m = $r->getMethod('mergeApplicationDefinition');
+ $m->setAccessible(true);
+ $m->invoke($command, false);
+ $this->assertTrue($command->getDefinition()->hasOption('bar'), '->mergeApplicationDefinition(false) merges the application and the command options');
+ $this->assertFalse($command->getDefinition()->hasArgument('foo'), '->mergeApplicationDefinition(false) does not merge the application arguments');
+
+ $m->invoke($command, true);
+ $this->assertTrue($command->getDefinition()->hasArgument('foo'), '->mergeApplicationDefinition(true) merges the application arguments and the command arguments');
+
+ $m->invoke($command);
+ $this->assertEquals(2, $command->getDefinition()->getArgumentCount(), '->mergeApplicationDefinition() does not try to merge twice the application arguments');
+ }
+
+ public function testRunInteractive()
+ {
+ $tester = new CommandTester(new \TestCommand());
+
+ $tester->execute(array(), array('interactive' => true));
+
+ $this->assertEquals('interact called'.PHP_EOL.'execute called'.PHP_EOL, $tester->getDisplay(), '->run() calls the interact() method if the input is interactive');
+ }
+
+ public function testRunNonInteractive()
+ {
+ $tester = new CommandTester(new \TestCommand());
+
+ $tester->execute(array(), array('interactive' => false));
+
+ $this->assertEquals('execute called'.PHP_EOL, $tester->getDisplay(), '->run() does not call the interact() method if the input is not interactive');
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage You must override the execute() method in the concrete command class.
+ */
+ public function testExecuteMethodNeedsToBeOverridden()
+ {
+ $command = new Command('foo');
+ $command->run(new StringInput(''), new NullOutput());
+ }
+
+ /**
+ * @expectedException Symfony\Component\Console\Exception\InvalidOptionException
+ * @expectedExceptionMessage The "--bar" option does not exist.
+ */
+ public function testRunWithInvalidOption()
+ {
+ $command = new \TestCommand();
+ $tester = new CommandTester($command);
+ $tester->execute(array('--bar' => true));
+ }
+
+ public function testRunReturnsIntegerExitCode()
+ {
+ $command = new \TestCommand();
+ $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->expects($this->once())
+ ->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)');
+ }
+
+ public function testRunWithApplication()
+ {
+ $command = new \TestCommand();
+ $command->setApplication(new Application());
+ $exitCode = $command->run(new StringInput(''), new NullOutput());
+
+ $this->assertSame(0, $exitCode, '->run() returns an integer exit code');
+ }
+
+ public function testRunReturnsAlwaysInteger()
+ {
+ $command = new \TestCommand();
+
+ $this->assertSame(0, $command->run(new StringInput(''), new NullOutput()));
+ }
+
+ public function testSetCode()
+ {
+ $command = new \TestCommand();
+ $ret = $command->setCode(function (InputInterface $input, OutputInterface $output) {
+ $output->writeln('from the code...');
+ });
+ $this->assertEquals($command, $ret, '->setCode() implements a fluent interface');
+ $tester = new CommandTester($command);
+ $tester->execute(array());
+ $this->assertEquals('interact called'.PHP_EOL.'from the code...'.PHP_EOL, $tester->getDisplay());
+ }
+
+ public function getSetCodeBindToClosureTests()
+ {
+ return array(
+ array(true, 'not bound to the command'),
+ array(false, 'bound to the command'),
+ );
+ }
+
+ /**
+ * @dataProvider getSetCodeBindToClosureTests
+ * @requires PHP 5.4
+ */
+ public function testSetCodeBindToClosure($previouslyBound, $expected)
+ {
+ $code = createClosure();
+ if ($previouslyBound) {
+ $code = $code->bindTo($this);
+ }
+
+ $command = new \TestCommand();
+ $command->setCode($code);
+ $tester = new CommandTester($command);
+ $tester->execute(array());
+ $this->assertEquals('interact called'.PHP_EOL.$expected.PHP_EOL, $tester->getDisplay());
+ }
+
+ public function testSetCodeWithNonClosureCallable()
+ {
+ $command = new \TestCommand();
+ $ret = $command->setCode(array($this, 'callableMethodCommand'));
+ $this->assertEquals($command, $ret, '->setCode() implements a fluent interface');
+ $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'));
+ }
+
+ public function callableMethodCommand(InputInterface $input, OutputInterface $output)
+ {
+ $output->writeln('from the code...');
+ }
+
+ /**
+ * @group legacy
+ */
+ public function testLegacyAsText()
+ {
+ $command = new \TestCommand();
+ $command->setApplication(new Application());
+ $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');
+ }
+
+ /**
+ * @group legacy
+ */
+ public function testLegacyAsXml()
+ {
+ $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');
+ }
+}
+
+// In order to get an unbound closure, we should create it outside a class
+// scope.
+function createClosure()
+{
+ return function (InputInterface $input, OutputInterface $output) {
+ $output->writeln($this instanceof Command ? 'bound to the command' : 'not bound to the command');
+ };
+}
diff --git a/vendor/symfony/console/Tests/Command/HelpCommandTest.php b/vendor/symfony/console/Tests/Command/HelpCommandTest.php
new file mode 100644
index 00000000..9e068587
--- /dev/null
+++ b/vendor/symfony/console/Tests/Command/HelpCommandTest.php
@@ -0,0 +1,70 @@
+<?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 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
+{
+ public function testExecuteForCommandAlias()
+ {
+ $command = new HelpCommand();
+ $command->setApplication(new Application());
+ $commandTester = new CommandTester($command);
+ $commandTester->execute(array('command_name' => 'li'), array('decorated' => false));
+ $this->assertContains('list [options] [--] [<namespace>]', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias');
+ $this->assertContains('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias');
+ $this->assertContains('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command alias');
+ }
+
+ public function testExecuteForCommand()
+ {
+ $command = new HelpCommand();
+ $commandTester = new CommandTester($command);
+ $command->setCommand(new ListCommand());
+ $commandTester->execute(array(), array('decorated' => false));
+ $this->assertContains('list [options] [--] [<namespace>]', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
+ $this->assertContains('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
+ $this->assertContains('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
+ }
+
+ public function testExecuteForCommandWithXmlOption()
+ {
+ $command = new HelpCommand();
+ $commandTester = new CommandTester($command);
+ $command->setCommand(new ListCommand());
+ $commandTester->execute(array('--format' => 'xml'));
+ $this->assertContains('<command', $commandTester->getDisplay(), '->execute() returns an XML help text if --xml is passed');
+ }
+
+ public function testExecuteForApplicationCommand()
+ {
+ $application = new Application();
+ $commandTester = new CommandTester($application->get('help'));
+ $commandTester->execute(array('command_name' => 'list'));
+ $this->assertContains('list [options] [--] [<namespace>]', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
+ $this->assertContains('format=FORMAT', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
+ $this->assertContains('raw', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
+ }
+
+ public function testExecuteForApplicationCommandWithXmlOption()
+ {
+ $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('<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
new file mode 100644
index 00000000..a166a040
--- /dev/null
+++ b/vendor/symfony/console/Tests/Command/ListCommandTest.php
@@ -0,0 +1,112 @@
+<?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 Symfony\Component\Console\Tester\CommandTester;
+use Symfony\Component\Console\Application;
+
+class ListCommandTest extends \PHPUnit_Framework_TestCase
+{
+ public function testExecuteListsCommands()
+ {
+ $application = new Application();
+ $commandTester = new CommandTester($command = $application->get('list'));
+ $commandTester->execute(array('command' => $command->getName()), array('decorated' => false));
+
+ $this->assertRegExp('/help\s{2,}Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands');
+ }
+
+ public function testExecuteListsCommandsWithXmlOption()
+ {
+ $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');
+ }
+
+ public function testExecuteListsCommandsWithRawOption()
+ {
+ $application = new Application();
+ $commandTester = new CommandTester($command = $application->get('list'));
+ $commandTester->execute(array('command' => $command->getName(), '--raw' => true));
+ $output = <<<'EOF'
+help Displays help for a command
+list Lists commands
+
+EOF;
+
+ $this->assertEquals($output, $commandTester->getDisplay(true));
+ }
+
+ public function testExecuteListsCommandsWithNamespaceArgument()
+ {
+ require_once realpath(__DIR__.'/../Fixtures/FooCommand.php');
+ $application = new Application();
+ $application->add(new \FooCommand());
+ $commandTester = new CommandTester($command = $application->get('list'));
+ $commandTester->execute(array('command' => $command->getName(), 'namespace' => 'foo', '--raw' => true));
+ $output = <<<'EOF'
+foo:bar The foo:bar command
+
+EOF;
+
+ $this->assertEquals($output, $commandTester->getDisplay(true));
+ }
+
+ public function testExecuteListsCommandsOrder()
+ {
+ require_once realpath(__DIR__.'/../Fixtures/Foo6Command.php');
+ $application = new Application();
+ $application->add(new \Foo6Command());
+ $commandTester = new CommandTester($command = $application->get('list'));
+ $commandTester->execute(array('command' => $command->getName()), array('decorated' => false));
+ $output = <<<'EOF'
+Console Tool
+
+Usage:
+ command [options] [arguments]
+
+Options:
+ -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
+
+Available commands:
+ help Displays help for a command
+ list Lists commands
+ 0foo
+ 0foo:bar 0foo:bar command
+EOF;
+
+ $this->assertEquals($output, trim($commandTester->getDisplay(true)));
+ }
+
+ public function testExecuteListsCommandsOrderRaw()
+ {
+ require_once realpath(__DIR__.'/../Fixtures/Foo6Command.php');
+ $application = new Application();
+ $application->add(new \Foo6Command());
+ $commandTester = new CommandTester($command = $application->get('list'));
+ $commandTester->execute(array('command' => $command->getName(), '--raw' => true));
+ $output = <<<'EOF'
+help Displays help for a command
+list Lists commands
+0foo:bar 0foo:bar command
+EOF;
+
+ $this->assertEquals($output, trim($commandTester->getDisplay(true)));
+ }
+}
diff --git a/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php
new file mode 100644
index 00000000..c36c4a8e
--- /dev/null
+++ b/vendor/symfony/console/Tests/Descriptor/AbstractDescriptorTest.php
@@ -0,0 +1,106 @@
+<?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\Descriptor;
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputArgument;
+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
+{
+ /** @dataProvider getDescribeInputArgumentTestData */
+ public function testDescribeInputArgument(InputArgument $argument, $expectedDescription)
+ {
+ $this->assertDescription($expectedDescription, $argument);
+ }
+
+ /** @dataProvider getDescribeInputOptionTestData */
+ public function testDescribeInputOption(InputOption $option, $expectedDescription)
+ {
+ $this->assertDescription($expectedDescription, $option);
+ }
+
+ /** @dataProvider getDescribeInputDefinitionTestData */
+ public function testDescribeInputDefinition(InputDefinition $definition, $expectedDescription)
+ {
+ $this->assertDescription($expectedDescription, $definition);
+ }
+
+ /** @dataProvider getDescribeCommandTestData */
+ public function testDescribeCommand(Command $command, $expectedDescription)
+ {
+ $this->assertDescription($expectedDescription, $command);
+ }
+
+ /** @dataProvider getDescribeApplicationTestData */
+ public function testDescribeApplication(Application $application, $expectedDescription)
+ {
+ // Replaces the dynamic placeholders of the command help text with a static version.
+ // The placeholder %command.full_name% includes the script path that is not predictable
+ // and can not be tested against.
+ foreach ($application->all() as $command) {
+ $command->setHelp(str_replace('%command.full_name%', 'app/console %command.name%', $command->getHelp()));
+ }
+
+ $this->assertDescription($expectedDescription, $application);
+ }
+
+ public function getDescribeInputArgumentTestData()
+ {
+ return $this->getDescriptionTestData(ObjectsProvider::getInputArguments());
+ }
+
+ public function getDescribeInputOptionTestData()
+ {
+ return $this->getDescriptionTestData(ObjectsProvider::getInputOptions());
+ }
+
+ public function getDescribeInputDefinitionTestData()
+ {
+ return $this->getDescriptionTestData(ObjectsProvider::getInputDefinitions());
+ }
+
+ public function getDescribeCommandTestData()
+ {
+ return $this->getDescriptionTestData(ObjectsProvider::getCommands());
+ }
+
+ public function getDescribeApplicationTestData()
+ {
+ return $this->getDescriptionTestData(ObjectsProvider::getApplications());
+ }
+
+ abstract protected function getDescriptor();
+
+ abstract protected function getFormat();
+
+ private function getDescriptionTestData(array $objects)
+ {
+ $data = array();
+ foreach ($objects as $name => $object) {
+ $description = file_get_contents(sprintf('%s/../Fixtures/%s.%s', __DIR__, $name, $this->getFormat()));
+ $data[] = array($object, $description);
+ }
+
+ return $data;
+ }
+
+ protected function assertDescription($expectedDescription, $describedObject)
+ {
+ $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
+ $this->getDescriptor()->describe($output, $describedObject, 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
new file mode 100644
index 00000000..f9a15612
--- /dev/null
+++ b/vendor/symfony/console/Tests/Descriptor/JsonDescriptorTest.php
@@ -0,0 +1,35 @@
+<?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\Descriptor;
+
+use Symfony\Component\Console\Descriptor\JsonDescriptor;
+use Symfony\Component\Console\Output\BufferedOutput;
+
+class JsonDescriptorTest extends AbstractDescriptorTest
+{
+ protected function getDescriptor()
+ {
+ return new JsonDescriptor();
+ }
+
+ protected function getFormat()
+ {
+ return 'json';
+ }
+
+ protected function assertDescription($expectedDescription, $describedObject)
+ {
+ $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
+ $this->getDescriptor()->describe($output, $describedObject, 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
new file mode 100644
index 00000000..c85e8a59
--- /dev/null
+++ b/vendor/symfony/console/Tests/Descriptor/MarkdownDescriptorTest.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\Descriptor;
+
+use Symfony\Component\Console\Descriptor\MarkdownDescriptor;
+
+class MarkdownDescriptorTest extends AbstractDescriptorTest
+{
+ protected function getDescriptor()
+ {
+ return new MarkdownDescriptor();
+ }
+
+ protected function getFormat()
+ {
+ return 'md';
+ }
+}
diff --git a/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php b/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php
new file mode 100644
index 00000000..45b3b2ff
--- /dev/null
+++ b/vendor/symfony/console/Tests/Descriptor/ObjectsProvider.php
@@ -0,0 +1,77 @@
+<?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\Descriptor;
+
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication1;
+use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication2;
+use Symfony\Component\Console\Tests\Fixtures\DescriptorCommand1;
+use Symfony\Component\Console\Tests\Fixtures\DescriptorCommand2;
+
+/**
+ * @author Jean-François Simon <contact@jfsimon.fr>
+ */
+class ObjectsProvider
+{
+ public static function getInputArguments()
+ {
+ return array(
+ 'input_argument_1' => new InputArgument('argument_name', InputArgument::REQUIRED),
+ '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"),
+ );
+ }
+
+ public static function getInputOptions()
+ {
+ return array(
+ 'input_option_1' => new InputOption('option_name', 'o', InputOption::VALUE_NONE),
+ 'input_option_2' => new InputOption('option_name', 'o', InputOption::VALUE_OPTIONAL, 'option description', 'default_value'),
+ 'input_option_3' => new InputOption('option_name', 'o', InputOption::VALUE_REQUIRED, 'option description'),
+ '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'),
+ );
+ }
+
+ public static function getInputDefinitions()
+ {
+ return array(
+ 'input_definition_1' => new InputDefinition(),
+ 'input_definition_2' => new InputDefinition(array(new InputArgument('argument_name', InputArgument::REQUIRED))),
+ 'input_definition_3' => new InputDefinition(array(new InputOption('option_name', 'o', InputOption::VALUE_NONE))),
+ 'input_definition_4' => new InputDefinition(array(
+ new InputArgument('argument_name', InputArgument::REQUIRED),
+ new InputOption('option_name', 'o', InputOption::VALUE_NONE),
+ )),
+ );
+ }
+
+ public static function getCommands()
+ {
+ return array(
+ 'command_1' => new DescriptorCommand1(),
+ 'command_2' => new DescriptorCommand2(),
+ );
+ }
+
+ public static function getApplications()
+ {
+ return array(
+ 'application_1' => new DescriptorApplication1(),
+ 'application_2' => new DescriptorApplication2(),
+ );
+ }
+}
diff --git a/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.php
new file mode 100644
index 00000000..350b6795
--- /dev/null
+++ b/vendor/symfony/console/Tests/Descriptor/TextDescriptorTest.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\Descriptor;
+
+use Symfony\Component\Console\Descriptor\TextDescriptor;
+
+class TextDescriptorTest extends AbstractDescriptorTest
+{
+ protected function getDescriptor()
+ {
+ return new TextDescriptor();
+ }
+
+ protected function getFormat()
+ {
+ return 'txt';
+ }
+}
diff --git a/vendor/symfony/console/Tests/Descriptor/XmlDescriptorTest.php b/vendor/symfony/console/Tests/Descriptor/XmlDescriptorTest.php
new file mode 100644
index 00000000..59a5d1ed
--- /dev/null
+++ b/vendor/symfony/console/Tests/Descriptor/XmlDescriptorTest.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\Descriptor;
+
+use Symfony\Component\Console\Descriptor\XmlDescriptor;
+
+class XmlDescriptorTest extends AbstractDescriptorTest
+{
+ protected function getDescriptor()
+ {
+ return new XmlDescriptor();
+ }
+
+ protected function getFormat()
+ {
+ return 'xml';
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/BarBucCommand.php b/vendor/symfony/console/Tests/Fixtures/BarBucCommand.php
new file mode 100644
index 00000000..52b619e8
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/BarBucCommand.php
@@ -0,0 +1,11 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+
+class BarBucCommand extends Command
+{
+ protected function configure()
+ {
+ $this->setName('bar:buc');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorApplication1.php b/vendor/symfony/console/Tests/Fixtures/DescriptorApplication1.php
new file mode 100644
index 00000000..132b6d57
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/DescriptorApplication1.php
@@ -0,0 +1,18 @@
+<?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 DescriptorApplication1 extends Application
+{
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.php b/vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.php
new file mode 100644
index 00000000..ff551358
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/DescriptorApplication2.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 DescriptorApplication2 extends Application
+{
+ public function __construct()
+ {
+ parent::__construct('My Symfony application', 'v1.0');
+ $this->add(new DescriptorCommand1());
+ $this->add(new DescriptorCommand2());
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand1.php b/vendor/symfony/console/Tests/Fixtures/DescriptorCommand1.php
new file mode 100644
index 00000000..ede05d7a
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/DescriptorCommand1.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 DescriptorCommand1 extends Command
+{
+ protected function configure()
+ {
+ $this
+ ->setName('descriptor:command1')
+ ->setAliases(array('alias1', 'alias2'))
+ ->setDescription('command 1 description')
+ ->setHelp('command 1 help')
+ ;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/DescriptorCommand2.php b/vendor/symfony/console/Tests/Fixtures/DescriptorCommand2.php
new file mode 100644
index 00000000..51106b96
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/DescriptorCommand2.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 DescriptorCommand2 extends Command
+{
+ protected function configure()
+ {
+ $this
+ ->setName('descriptor:command2')
+ ->setDescription('command 2 description')
+ ->setHelp('command 2 help')
+ ->addUsage('-o|--option_name <argument_name>')
+ ->addUsage('<argument_name>')
+ ->addArgument('argument_name', InputArgument::REQUIRED)
+ ->addOption('option_name', 'o', InputOption::VALUE_NONE)
+ ;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/DummyOutput.php b/vendor/symfony/console/Tests/Fixtures/DummyOutput.php
new file mode 100644
index 00000000..0070c0a4
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/DummyOutput.php
@@ -0,0 +1,36 @@
+<?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\Output\BufferedOutput;
+
+/**
+ * Dummy output.
+ *
+ * @author Kévin Dunglas <dunglas@gmail.com>
+ */
+class DummyOutput extends BufferedOutput
+{
+ /**
+ * @return array
+ */
+ public function getLogs()
+ {
+ $logs = array();
+ foreach (explode("\n", trim($this->fetch())) as $message) {
+ preg_match('/^\[(.*)\] (.*)/', $message, $matches);
+ $logs[] = sprintf('%s %s', $matches[1], $matches[2]);
+ }
+
+ return $logs;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/Foo1Command.php b/vendor/symfony/console/Tests/Fixtures/Foo1Command.php
new file mode 100644
index 00000000..254162f3
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Foo1Command.php
@@ -0,0 +1,26 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class Foo1Command extends Command
+{
+ public $input;
+ public $output;
+
+ protected function configure()
+ {
+ $this
+ ->setName('foo:bar1')
+ ->setDescription('The foo:bar1 command')
+ ->setAliases(array('afoobar1'))
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->input = $input;
+ $this->output = $output;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/Foo2Command.php b/vendor/symfony/console/Tests/Fixtures/Foo2Command.php
new file mode 100644
index 00000000..8071dc8f
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Foo2Command.php
@@ -0,0 +1,21 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class Foo2Command extends Command
+{
+ protected function configure()
+ {
+ $this
+ ->setName('foo1:bar')
+ ->setDescription('The foo1:bar command')
+ ->setAliases(array('afoobar2'))
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/Foo3Command.php b/vendor/symfony/console/Tests/Fixtures/Foo3Command.php
new file mode 100644
index 00000000..6c890faf
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Foo3Command.php
@@ -0,0 +1,29 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class Foo3Command extends Command
+{
+ protected function configure()
+ {
+ $this
+ ->setName('foo3:bar')
+ ->setDescription('The foo3:bar command')
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ try {
+ try {
+ throw new \Exception('First exception <p>this is html</p>');
+ } catch (\Exception $e) {
+ 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);
+ }
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/Foo4Command.php b/vendor/symfony/console/Tests/Fixtures/Foo4Command.php
new file mode 100644
index 00000000..1c546399
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Foo4Command.php
@@ -0,0 +1,11 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+
+class Foo4Command extends Command
+{
+ protected function configure()
+ {
+ $this->setName('foo3:bar:toh');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/Foo5Command.php b/vendor/symfony/console/Tests/Fixtures/Foo5Command.php
new file mode 100644
index 00000000..a1c60827
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Foo5Command.php
@@ -0,0 +1,10 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+
+class Foo5Command extends Command
+{
+ public function __construct()
+ {
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/Foo6Command.php b/vendor/symfony/console/Tests/Fixtures/Foo6Command.php
new file mode 100644
index 00000000..6ae987e4
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Foo6Command.php
@@ -0,0 +1,12 @@
+<?php
+
+
+use Symfony\Component\Console\Command\Command;
+
+class Foo6Command extends Command
+{
+ protected function configure()
+ {
+ $this->setName('0foo:bar')->setDescription('0foo:bar command');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooCommand.php b/vendor/symfony/console/Tests/Fixtures/FooCommand.php
new file mode 100644
index 00000000..355e0ad6
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/FooCommand.php
@@ -0,0 +1,33 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class FooCommand extends Command
+{
+ public $input;
+ public $output;
+
+ protected function configure()
+ {
+ $this
+ ->setName('foo:bar')
+ ->setDescription('The foo:bar command')
+ ->setAliases(array('afoobar'))
+ ;
+ }
+
+ 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');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced1Command.php b/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced1Command.php
new file mode 100644
index 00000000..fc50c72b
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced1Command.php
@@ -0,0 +1,26 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class FooSubnamespaced1Command extends Command
+{
+ public $input;
+ public $output;
+
+ protected function configure()
+ {
+ $this
+ ->setName('foo:bar:baz')
+ ->setDescription('The foo:bar:baz command')
+ ->setAliases(array('foobarbaz'))
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->input = $input;
+ $this->output = $output;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced2Command.php b/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced2Command.php
new file mode 100644
index 00000000..1cf31ff1
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/FooSubnamespaced2Command.php
@@ -0,0 +1,26 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class FooSubnamespaced2Command extends Command
+{
+ public $input;
+ public $output;
+
+ protected function configure()
+ {
+ $this
+ ->setName('foo:go:bret')
+ ->setDescription('The foo:bar:go command')
+ ->setAliases(array('foobargo'))
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->input = $input;
+ $this->output = $output;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/FoobarCommand.php b/vendor/symfony/console/Tests/Fixtures/FoobarCommand.php
new file mode 100644
index 00000000..96816280
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/FoobarCommand.php
@@ -0,0 +1,25 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class FoobarCommand extends Command
+{
+ public $input;
+ public $output;
+
+ protected function configure()
+ {
+ $this
+ ->setName('foobar:foo')
+ ->setDescription('The foobar:foo command')
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->input = $input;
+ $this->output = $output;
+ }
+}
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
new file mode 100644
index 00000000..996fafb9
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_0.php
@@ -0,0 +1,11 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+
+//Ensure has single blank line at start when using block element
+return function (InputInterface $input, OutputInterface $output) {
+ $output = new SymfonyStyleWithForcedLineLength($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
new file mode 100644
index 00000000..6634cd56
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_1.php
@@ -0,0 +1,13 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+
+//Ensure has single blank line between titles and blocks
+return function (InputInterface $input, OutputInterface $output) {
+ $output = new SymfonyStyleWithForcedLineLength($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
new file mode 100644
index 00000000..4120df9c
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_10.php
@@ -0,0 +1,17 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+
+//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->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',
+ 'fg=white;bg=green',
+ 'X ',
+ true
+ );
+};
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
new file mode 100644
index 00000000..a2781ddb
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_11.php
@@ -0,0 +1,13 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+
+//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 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'
+ );
+};
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
new file mode 100644
index 00000000..6004e3d6
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_2.php
@@ -0,0 +1,16 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+
+//Ensure has single blank line between blocks
+return function (InputInterface $input, OutputInterface $output) {
+ $output = new SymfonyStyleWithForcedLineLength($input, $output);
+ $output->warning('Warning');
+ $output->caution('Caution');
+ $output->error('Error');
+ $output->success('Success');
+ $output->note('Note');
+ $output->block('Custom block', 'CUSTOM', 'fg=white;bg=green', 'X ', true);
+};
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
new file mode 100644
index 00000000..c7a08f13
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_3.php
@@ -0,0 +1,12 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+
+//Ensure has single blank line between two titles
+return function (InputInterface $input, OutputInterface $output) {
+ $output = new SymfonyStyleWithForcedLineLength($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
new file mode 100644
index 00000000..afea70c7
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_4.php
@@ -0,0 +1,34 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+
+//Ensure has single blank line after any text and a title
+return function (InputInterface $input, OutputInterface $output) {
+ $output = new SymfonyStyleWithForcedLineLength($input, $output);
+
+ $output->write('Lorem ipsum dolor sit amet');
+ $output->title('First title');
+
+ $output->writeln('Lorem ipsum dolor sit amet');
+ $output->title('Second title');
+
+ $output->write('Lorem ipsum dolor sit amet');
+ $output->write('');
+ $output->title('Third title');
+
+ //Ensure edge case by appending empty strings to history:
+ $output->write('Lorem ipsum dolor sit amet');
+ $output->write(array('', '', ''));
+ $output->title('Fourth title');
+
+ //Ensure have manual control over number of blank lines:
+ $output->writeln('Lorem ipsum dolor sit amet');
+ $output->writeln(array('', '')); //Should append an extra blank line
+ $output->title('Fifth title');
+
+ $output->writeln('Lorem ipsum dolor sit amet');
+ $output->newLine(2); //Should append an extra blank line
+ $output->title('Fifth 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
new file mode 100644
index 00000000..d2c68a9e
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_5.php
@@ -0,0 +1,37 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+
+//Ensure has proper line ending before outputing a text block like with SymfonyStyle::listing() or SymfonyStyle::text()
+return function (InputInterface $input, OutputInterface $output) {
+ $output = new SymfonyStyleWithForcedLineLength($input, $output);
+
+ $output->writeln('Lorem ipsum dolor sit amet');
+ $output->listing(array(
+ 'Lorem ipsum dolor sit amet',
+ 'consectetur adipiscing elit',
+ ));
+
+ //Even using write:
+ $output->write('Lorem ipsum dolor sit amet');
+ $output->listing(array(
+ 'Lorem ipsum dolor sit amet',
+ 'consectetur adipiscing elit',
+ ));
+
+ $output->write('Lorem ipsum dolor sit amet');
+ $output->text(array(
+ 'Lorem ipsum dolor sit amet',
+ 'consectetur adipiscing elit',
+ ));
+
+ $output->newLine();
+
+ $output->write('Lorem ipsum dolor sit amet');
+ $output->comment(array(
+ 'Lorem ipsum dolor sit amet',
+ 'consectetur adipiscing elit',
+ ));
+};
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
new file mode 100644
index 00000000..f1d79905
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_6.php
@@ -0,0 +1,16 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+
+//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->listing(array(
+ 'Lorem ipsum dolor sit amet',
+ 'consectetur adipiscing elit',
+ ));
+ $output->success('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
new file mode 100644
index 00000000..cbfea734
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_7.php
@@ -0,0 +1,15 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+
+//Ensure questions do not output anything when input is non-interactive
+return function (InputInterface $input, OutputInterface $output) {
+ $output = new SymfonyStyleWithForcedLineLength($input, $output);
+ $output->title('Title');
+ $output->askHidden('Hidden question');
+ $output->choice('Choice question with default', array('choice1', 'choice2'), 'choice1');
+ $output->confirm('Confirmation with yes default', true);
+ $output->text('Duis aute irure dolor in reprehenderit in voluptate velit esse');
+};
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
new file mode 100644
index 00000000..0244fd27
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_8.php
@@ -0,0 +1,26 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+use Symfony\Component\Console\Helper\TableCell;
+
+//Ensure formatting tables when using multiple headers with TableCell
+return function (InputInterface $input, OutputInterface $output) {
+ $headers = array(
+ array(new TableCell('Main table title', array('colspan' => 3))),
+ array('ISBN', 'Title', 'Author'),
+ );
+
+ $rows = array(
+ array(
+ '978-0521567817',
+ 'De Monarchia',
+ new TableCell("Dante Alighieri\nspans multiple rows", array('rowspan' => 2)),
+ ),
+ array('978-0804169127', 'Divine Comedy'),
+ );
+
+ $output = new SymfonyStyleWithForcedLineLength($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
new file mode 100644
index 00000000..6420730f
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/command/command_9.php
@@ -0,0 +1,11 @@
+<?php
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
+
+//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->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/output/output_0.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_0.txt
new file mode 100644
index 00000000..a42e0f79
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_0.txt
@@ -0,0 +1,3 @@
+
+ ! [CAUTION] Lorem ipsum dolor sit amet
+
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_1.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_1.txt
new file mode 100644
index 00000000..334875f7
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_1.txt
@@ -0,0 +1,9 @@
+
+Title
+=====
+
+ [WARNING] Lorem ipsum dolor sit amet
+
+Title
+=====
+
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_10.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_10.txt
new file mode 100644
index 00000000..385c6a28
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_10.txt
@@ -0,0 +1,7 @@
+
+X [CUSTOM] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et
+X dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
+X commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat
+X nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
+X anim id est laborum
+
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
new file mode 100644
index 00000000..9983af83
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_11.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_2.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_2.txt
new file mode 100644
index 00000000..ca609760
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_2.txt
@@ -0,0 +1,13 @@
+
+ [WARNING] Warning
+
+ ! [CAUTION] Caution
+
+ [ERROR] Error
+
+ [OK] Success
+
+ ! [NOTE] Note
+
+X [CUSTOM] Custom block
+
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_3.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_3.txt
new file mode 100644
index 00000000..f4b6d582
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_3.txt
@@ -0,0 +1,7 @@
+
+First title
+===========
+
+Second title
+============
+
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_4.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_4.txt
new file mode 100644
index 00000000..2646d858
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_4.txt
@@ -0,0 +1,32 @@
+Lorem ipsum dolor sit amet
+
+First title
+===========
+
+Lorem ipsum dolor sit amet
+
+Second title
+============
+
+Lorem ipsum dolor sit amet
+
+Third title
+===========
+
+Lorem ipsum dolor sit amet
+
+Fourth title
+============
+
+Lorem ipsum dolor sit amet
+
+
+Fifth title
+===========
+
+Lorem ipsum dolor sit amet
+
+
+Fifth title
+===========
+
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_5.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_5.txt
new file mode 100644
index 00000000..be4a2db6
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_5.txt
@@ -0,0 +1,18 @@
+Lorem ipsum dolor sit amet
+ * Lorem ipsum dolor sit amet
+ * consectetur adipiscing elit
+
+Lorem ipsum dolor sit amet
+ * Lorem ipsum dolor sit amet
+ * consectetur adipiscing elit
+
+Lorem ipsum dolor sit amet
+ Lorem ipsum dolor sit amet
+ consectetur adipiscing elit
+
+Lorem ipsum dolor sit amet
+
+ // Lorem ipsum dolor sit amet
+ //
+ // consectetur adipiscing elit
+
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_6.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_6.txt
new file mode 100644
index 00000000..5f2d33c1
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_6.txt
@@ -0,0 +1,6 @@
+
+ * Lorem ipsum dolor sit amet
+ * consectetur adipiscing elit
+
+ [OK] Lorem ipsum dolor sit amet
+
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_7.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_7.txt
new file mode 100644
index 00000000..ecea9778
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_7.txt
@@ -0,0 +1,5 @@
+
+Title
+=====
+
+ Duis aute irure dolor in reprehenderit in voluptate velit esse
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_8.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_8.txt
new file mode 100644
index 00000000..005b846e
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_8.txt
@@ -0,0 +1,9 @@
+ ---------------- --------------- ---------------------
+ Main table title
+ ---------------- --------------- ---------------------
+ ISBN Title Author
+ ---------------- --------------- ---------------------
+ 978-0521567817 De Monarchia Dante Alighieri
+ 978-0804169127 Divine Comedy spans multiple rows
+ ---------------- --------------- ---------------------
+
diff --git a/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_9.txt b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_9.txt
new file mode 100644
index 00000000..069c0d51
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/Style/SymfonyStyle/output/output_9.txt
@@ -0,0 +1,5 @@
+
+X [CUSTOM] Custom block
+X
+X Second custom block line
+
diff --git a/vendor/symfony/console/Tests/Fixtures/TestCommand.php b/vendor/symfony/console/Tests/Fixtures/TestCommand.php
new file mode 100644
index 00000000..dcd32739
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/TestCommand.php
@@ -0,0 +1,28 @@
+<?php
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class TestCommand extends Command
+{
+ protected function configure()
+ {
+ $this
+ ->setName('namespace:name')
+ ->setAliases(array('name'))
+ ->setDescription('description')
+ ->setHelp('help')
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $output->writeln('execute called');
+ }
+
+ protected function interact(InputInterface $input, OutputInterface $output)
+ {
+ $output->writeln('interact called');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.json b/vendor/symfony/console/Tests/Fixtures/application_1.json
new file mode 100644
index 00000000..b17b38d8
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_1.json
@@ -0,0 +1 @@
+{"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"]}]}
diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.md b/vendor/symfony/console/Tests/Fixtures/application_1.md
new file mode 100644
index 00000000..82a605da
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_1.md
@@ -0,0 +1,201 @@
+UNKNOWN
+=======
+
+* help
+* list
+
+help
+----
+
+* Description: Displays help for a command
+* Usage:
+
+ * `help [--xml] [--format FORMAT] [--raw] [--] [<command_name>]`
+
+The <info>help</info> command displays help for a given command:
+
+ <info>php app/console help list</info>
+
+You can also output the help in other formats by using the <comment>--format</comment> option:
+
+ <info>php app/console help --format=xml list</info>
+
+To display the list of available commands, please use the <info>list</info> command.
+
+### Arguments:
+
+**command_name:**
+
+* Name: command_name
+* Is required: no
+* Is array: no
+* Description: The command name
+* Default: `'help'`
+
+### Options:
+
+**xml:**
+
+* Name: `--xml`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: To output help as XML
+* Default: `false`
+
+**format:**
+
+* 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:**
+
+* Name: `--raw`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: To output raw command help
+* Default: `false`
+
+**help:**
+
+* Name: `--help`
+* Shortcut: `-h`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Display this help message
+* Default: `false`
+
+**quiet:**
+
+* Name: `--quiet`
+* Shortcut: `-q`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Do not output any message
+* Default: `false`
+
+**verbose:**
+
+* 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:**
+
+* Name: `--version`
+* Shortcut: `-V`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Display this application version
+* Default: `false`
+
+**ansi:**
+
+* Name: `--ansi`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Force ANSI output
+* Default: `false`
+
+**no-ansi:**
+
+* Name: `--no-ansi`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Disable ANSI output
+* Default: `false`
+
+**no-interaction:**
+
+* 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
+----
+
+* Description: Lists commands
+* Usage:
+
+ * `list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]`
+
+The <info>list</info> command lists all commands:
+
+ <info>php app/console list</info>
+
+You can also display the commands for a specific namespace:
+
+ <info>php app/console list test</info>
+
+You can also output the information in other formats by using the <comment>--format</comment> option:
+
+ <info>php app/console list --format=xml</info>
+
+It's also possible to get raw list of commands (useful for embedding command runner):
+
+ <info>php app/console list --raw</info>
+
+### Arguments:
+
+**namespace:**
+
+* Name: namespace
+* Is required: no
+* Is array: no
+* Description: The namespace name
+* Default: `NULL`
+
+### Options:
+
+**xml:**
+
+* Name: `--xml`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: To output list as XML
+* Default: `false`
+
+**raw:**
+
+* Name: `--raw`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: To output raw command list
+* Default: `false`
+
+**format:**
+
+* 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
new file mode 100644
index 00000000..c4cf8f21
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_1.txt
@@ -0,0 +1,17 @@
+<info>Console Tool</info>
+
+<comment>Usage:</comment>
+ command [options] [arguments]
+
+<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>Available commands:</comment>
+ <info>help</info> Displays help for a command
+ <info>list</info> Lists commands
diff --git a/vendor/symfony/console/Tests/Fixtures/application_1.xml b/vendor/symfony/console/Tests/Fixtures/application_1.xml
new file mode 100644
index 00000000..35d1db4d
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_1.xml
@@ -0,0 +1,110 @@
+<?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>
+ </commands>
+ <namespaces>
+ <namespace id="_global">
+ <command>help</command>
+ <command>list</command>
+ </namespace>
+ </namespaces>
+</symfony>
diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.json b/vendor/symfony/console/Tests/Fixtures/application_2.json
new file mode 100644
index 00000000..e47a7a96
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_2.json
@@ -0,0 +1 @@
+{"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
diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.md b/vendor/symfony/console/Tests/Fixtures/application_2.md
new file mode 100644
index 00000000..f031c9e5
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_2.md
@@ -0,0 +1,396 @@
+My Symfony application
+======================
+
+* alias1
+* alias2
+* help
+* list
+
+**descriptor:**
+
+* descriptor:command1
+* descriptor:command2
+
+help
+----
+
+* Description: Displays help for a command
+* Usage:
+
+ * `help [--xml] [--format FORMAT] [--raw] [--] [<command_name>]`
+
+The <info>help</info> command displays help for a given command:
+
+ <info>php app/console help list</info>
+
+You can also output the help in other formats by using the <comment>--format</comment> option:
+
+ <info>php app/console help --format=xml list</info>
+
+To display the list of available commands, please use the <info>list</info> command.
+
+### Arguments:
+
+**command_name:**
+
+* Name: command_name
+* Is required: no
+* Is array: no
+* Description: The command name
+* Default: `'help'`
+
+### Options:
+
+**xml:**
+
+* Name: `--xml`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: To output help as XML
+* Default: `false`
+
+**format:**
+
+* 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:**
+
+* Name: `--raw`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: To output raw command help
+* Default: `false`
+
+**help:**
+
+* Name: `--help`
+* Shortcut: `-h`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Display this help message
+* Default: `false`
+
+**quiet:**
+
+* Name: `--quiet`
+* Shortcut: `-q`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Do not output any message
+* Default: `false`
+
+**verbose:**
+
+* 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:**
+
+* Name: `--version`
+* Shortcut: `-V`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Display this application version
+* Default: `false`
+
+**ansi:**
+
+* Name: `--ansi`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Force ANSI output
+* Default: `false`
+
+**no-ansi:**
+
+* Name: `--no-ansi`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Disable ANSI output
+* Default: `false`
+
+**no-interaction:**
+
+* 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
+----
+
+* Description: Lists commands
+* Usage:
+
+ * `list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]`
+
+The <info>list</info> command lists all commands:
+
+ <info>php app/console list</info>
+
+You can also display the commands for a specific namespace:
+
+ <info>php app/console list test</info>
+
+You can also output the information in other formats by using the <comment>--format</comment> option:
+
+ <info>php app/console list --format=xml</info>
+
+It's also possible to get raw list of commands (useful for embedding command runner):
+
+ <info>php app/console list --raw</info>
+
+### Arguments:
+
+**namespace:**
+
+* Name: namespace
+* Is required: no
+* Is array: no
+* Description: The namespace name
+* Default: `NULL`
+
+### Options:
+
+**xml:**
+
+* Name: `--xml`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: To output list as XML
+* Default: `false`
+
+**raw:**
+
+* Name: `--raw`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: To output raw command list
+* Default: `false`
+
+**format:**
+
+* 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
+-------------------
+
+* Description: command 1 description
+* Usage:
+
+ * `descriptor:command1`
+ * `alias1`
+ * `alias2`
+
+command 1 help
+
+### Options:
+
+**help:**
+
+* Name: `--help`
+* Shortcut: `-h`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Display this help message
+* Default: `false`
+
+**quiet:**
+
+* Name: `--quiet`
+* Shortcut: `-q`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Do not output any message
+* Default: `false`
+
+**verbose:**
+
+* 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:**
+
+* Name: `--version`
+* Shortcut: `-V`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Display this application version
+* Default: `false`
+
+**ansi:**
+
+* Name: `--ansi`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Force ANSI output
+* Default: `false`
+
+**no-ansi:**
+
+* Name: `--no-ansi`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Disable ANSI output
+* Default: `false`
+
+**no-interaction:**
+
+* 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
+-------------------
+
+* Description: command 2 description
+* Usage:
+
+ * `descriptor:command2 [-o|--option_name] [--] <argument_name>`
+ * `descriptor:command2 -o|--option_name <argument_name>`
+ * `descriptor:command2 <argument_name>`
+
+command 2 help
+
+### Arguments:
+
+**argument_name:**
+
+* Name: argument_name
+* Is required: yes
+* Is array: no
+* Description: <none>
+* Default: `NULL`
+
+### Options:
+
+**option_name:**
+
+* Name: `--option_name`
+* Shortcut: `-o`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: <none>
+* Default: `false`
+
+**help:**
+
+* Name: `--help`
+* Shortcut: `-h`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Display this help message
+* Default: `false`
+
+**quiet:**
+
+* Name: `--quiet`
+* Shortcut: `-q`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Do not output any message
+* Default: `false`
+
+**verbose:**
+
+* 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:**
+
+* Name: `--version`
+* Shortcut: `-V`
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Display this application version
+* Default: `false`
+
+**ansi:**
+
+* Name: `--ansi`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Force ANSI output
+* Default: `false`
+
+**no-ansi:**
+
+* Name: `--no-ansi`
+* Shortcut: <none>
+* Accept value: no
+* Is value required: no
+* Is multiple: no
+* Description: Disable ANSI output
+* Default: `false`
+
+**no-interaction:**
+
+* 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
new file mode 100644
index 00000000..292aa829
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_2.txt
@@ -0,0 +1,22 @@
+<info>My Symfony application</info> version <comment>v1.0</comment>
+
+<comment>Usage:</comment>
+ command [options] [arguments]
+
+<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>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:command2</info> command 2 description
diff --git a/vendor/symfony/console/Tests/Fixtures/application_2.xml b/vendor/symfony/console/Tests/Fixtures/application_2.xml
new file mode 100644
index 00000000..bc8ab219
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_2.xml
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<symfony name="My Symfony application" version="v1.0">
+ <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="descriptor:command1" name="descriptor:command1">
+ <usages>
+ <usage>descriptor:command1</usage>
+ <usage>alias1</usage>
+ <usage>alias2</usage>
+ </usages>
+ <description>command 1 description</description>
+ <help>command 1 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:command2" name="descriptor:command2">
+ <usages>
+ <usage>descriptor:command2 [-o|--option_name] [--] &lt;argument_name&gt;</usage>
+ <usage>descriptor:command2 -o|--option_name &lt;argument_name&gt;</usage>
+ <usage>descriptor:command2 &lt;argument_name&gt;</usage>
+ </usages>
+ <description>command 2 description</description>
+ <help>command 2 help</help>
+ <arguments>
+ <argument name="argument_name" is_required="1" is_array="0">
+ <description></description>
+ <defaults/>
+ </argument>
+ </arguments>
+ <options>
+ <option name="--option_name" shortcut="-o" accept_value="0" is_value_required="0" is_multiple="0">
+ <description></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>
+ </commands>
+ <namespaces>
+ <namespace id="_global">
+ <command>alias1</command>
+ <command>alias2</command>
+ <command>help</command>
+ <command>list</command>
+ </namespace>
+ <namespace id="descriptor">
+ <command>descriptor:command1</command>
+ <command>descriptor:command2</command>
+ </namespace>
+ </namespaces>
+</symfony>
diff --git a/vendor/symfony/console/Tests/Fixtures/application_astext1.txt b/vendor/symfony/console/Tests/Fixtures/application_astext1.txt
new file mode 100644
index 00000000..19dacb23
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_astext1.txt
@@ -0,0 +1,20 @@
+<info>Console Tool</info>
+
+<comment>Usage:</comment>
+ command [options] [arguments]
+
+<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>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
diff --git a/vendor/symfony/console/Tests/Fixtures/application_astext2.txt b/vendor/symfony/console/Tests/Fixtures/application_astext2.txt
new file mode 100644
index 00000000..c99ccdda
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_astext2.txt
@@ -0,0 +1,16 @@
+<info>Console Tool</info>
+
+<comment>Usage:</comment>
+ command [options] [arguments]
+
+<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>Available commands for the "foo" namespace:</comment>
+ <info>foo:bar</info> The foo:bar command
diff --git a/vendor/symfony/console/Tests/Fixtures/application_asxml1.txt b/vendor/symfony/console/Tests/Fixtures/application_asxml1.txt
new file mode 100644
index 00000000..8277d9e6
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_asxml1.txt
@@ -0,0 +1,146 @@
+<?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
new file mode 100644
index 00000000..93d6d4e9
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_asxml2.txt
@@ -0,0 +1,37 @@
+<?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_gethelp.txt b/vendor/symfony/console/Tests/Fixtures/application_gethelp.txt
new file mode 100644
index 00000000..0c16e3c8
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_gethelp.txt
@@ -0,0 +1 @@
+<info>Console Tool</info> \ No newline at end of file
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt
new file mode 100644
index 00000000..919cec42
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception1.txt
@@ -0,0 +1,6 @@
+
+
+ [Symfony\Component\Console\Exception\CommandNotFoundException]
+ 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
new file mode 100644
index 00000000..d9e93da4
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception2.txt
@@ -0,0 +1,8 @@
+
+
+ [Symfony\Component\Console\Exception\InvalidOptionException]
+ The "--foo" option does not exist.
+
+
+list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]
+
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt
new file mode 100644
index 00000000..8276137b
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception3.txt
@@ -0,0 +1,18 @@
+
+
+ [Exception]
+ Third exception comment
+
+
+
+ [Exception]
+ Second exception comment
+
+
+
+ [Exception]
+ First exception <p>this is html</p>
+
+
+foo3:bar
+
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt
new file mode 100644
index 00000000..b4a7b018
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception3decorated.txt
@@ -0,0 +1,18 @@
+
+ 
+ [Exception] 
+ Third exception comment 
+ 
+
+ 
+ [Exception] 
+ Second exception comment 
+ 
+
+ 
+ [Exception] 
+ 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
new file mode 100644
index 00000000..cb080e9c
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception4.txt
@@ -0,0 +1,7 @@
+
+
+ [Symfony\Component\Console\Exception\CommandNotFoundException]
+ 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
new file mode 100644
index 00000000..1ba5f8fd
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1.txt
@@ -0,0 +1,8 @@
+
+
+ [Exception]
+ エラーメッセージ
+
+
+foo
+
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt
new file mode 100644
index 00000000..20644251
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt
@@ -0,0 +1,8 @@
+
+ 
+ [Exception] 
+ エラーメッセージ 
+ 
+
+foo
+
diff --git a/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt
new file mode 100644
index 00000000..e41fcfcf
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_renderexception_doublewidth2.txt
@@ -0,0 +1,9 @@
+
+
+ [Exception]
+ コマンドの実行中にエラーが
+ 発生しました。
+
+
+foo
+
diff --git a/vendor/symfony/console/Tests/Fixtures/application_run1.txt b/vendor/symfony/console/Tests/Fixtures/application_run1.txt
new file mode 100644
index 00000000..0dc27309
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_run1.txt
@@ -0,0 +1,17 @@
+Console Tool
+
+Usage:
+ command [options] [arguments]
+
+Options:
+ -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
+
+Available commands:
+ help Displays help for a command
+ list Lists commands
diff --git a/vendor/symfony/console/Tests/Fixtures/application_run2.txt b/vendor/symfony/console/Tests/Fixtures/application_run2.txt
new file mode 100644
index 00000000..d28b928e
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_run2.txt
@@ -0,0 +1,29 @@
+Usage:
+ help [options] [--] [<command_name>]
+
+Arguments:
+ command The command to execute
+ command_name The command name [default: "help"]
+
+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
+
+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.
diff --git a/vendor/symfony/console/Tests/Fixtures/application_run3.txt b/vendor/symfony/console/Tests/Fixtures/application_run3.txt
new file mode 100644
index 00000000..bc51995f
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_run3.txt
@@ -0,0 +1,27 @@
+Usage:
+ list [options] [--] [<namespace>]
+
+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
diff --git a/vendor/symfony/console/Tests/Fixtures/application_run4.txt b/vendor/symfony/console/Tests/Fixtures/application_run4.txt
new file mode 100644
index 00000000..47187fc2
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/application_run4.txt
@@ -0,0 +1 @@
+Console Tool
diff --git a/vendor/symfony/console/Tests/Fixtures/command_1.json b/vendor/symfony/console/Tests/Fixtures/command_1.json
new file mode 100644
index 00000000..20f310b4
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/command_1.json
@@ -0,0 +1 @@
+{"name":"descriptor:command1","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
new file mode 100644
index 00000000..34ed3ea7
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/command_1.md
@@ -0,0 +1,11 @@
+descriptor:command1
+-------------------
+
+* Description: command 1 description
+* 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
new file mode 100644
index 00000000..28e14a05
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/command_1.txt
@@ -0,0 +1,7 @@
+<comment>Usage:</comment>
+ descriptor:command1
+ alias1
+ alias2
+
+<comment>Help:</comment>
+ command 1 help
diff --git a/vendor/symfony/console/Tests/Fixtures/command_1.xml b/vendor/symfony/console/Tests/Fixtures/command_1.xml
new file mode 100644
index 00000000..838b9bd9
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/command_1.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<command id="descriptor:command1" name="descriptor:command1">
+ <usages>
+ <usage>descriptor:command1</usage>
+ <usage>alias1</usage>
+ <usage>alias2</usage>
+ </usages>
+ <description>command 1 description</description>
+ <help>command 1 help</help>
+ <arguments/>
+ <options/>
+</command>
diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.json b/vendor/symfony/console/Tests/Fixtures/command_2.json
new file mode 100644
index 00000000..38edd1e2
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/command_2.json
@@ -0,0 +1 @@
+{"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}}}}
diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.md b/vendor/symfony/console/Tests/Fixtures/command_2.md
new file mode 100644
index 00000000..6f538b64
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/command_2.md
@@ -0,0 +1,33 @@
+descriptor:command2
+-------------------
+
+* Description: command 2 description
+* Usage:
+
+ * `descriptor:command2 [-o|--option_name] [--] <argument_name>`
+ * `descriptor:command2 -o|--option_name <argument_name>`
+ * `descriptor:command2 <argument_name>`
+
+command 2 help
+
+### Arguments:
+
+**argument_name:**
+
+* Name: argument_name
+* Is required: yes
+* Is array: no
+* Description: <none>
+* Default: `NULL`
+
+### Options:
+
+**option_name:**
+
+* 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
new file mode 100644
index 00000000..72f7ce05
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/command_2.txt
@@ -0,0 +1,13 @@
+<comment>Usage:</comment>
+ descriptor:command2 [options] [--] <argument_name>
+ descriptor:command2 -o|--option_name <argument_name>
+ descriptor:command2 <argument_name>
+
+<comment>Arguments:</comment>
+ <info>argument_name</info>
+
+<comment>Options:</comment>
+ <info>-o, --option_name</info>
+
+<comment>Help:</comment>
+ command 2 help
diff --git a/vendor/symfony/console/Tests/Fixtures/command_2.xml b/vendor/symfony/console/Tests/Fixtures/command_2.xml
new file mode 100644
index 00000000..67364caa
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/command_2.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<command id="descriptor:command2" name="descriptor:command2">
+ <usages>
+ <usage>descriptor:command2 [-o|--option_name] [--] &lt;argument_name&gt;</usage>
+ <usage>descriptor:command2 -o|--option_name &lt;argument_name&gt;</usage>
+ <usage>descriptor:command2 &lt;argument_name&gt;</usage>
+ </usages>
+ <description>command 2 description</description>
+ <help>command 2 help</help>
+ <arguments>
+ <argument name="argument_name" is_required="1" is_array="0">
+ <description></description>
+ <defaults/>
+ </argument>
+ </arguments>
+ <options>
+ <option name="--option_name" shortcut="-o" accept_value="0" is_value_required="0" is_multiple="0">
+ <description></description>
+ </option>
+ </options>
+</command>
diff --git a/vendor/symfony/console/Tests/Fixtures/command_astext.txt b/vendor/symfony/console/Tests/Fixtures/command_astext.txt
new file mode 100644
index 00000000..7e206388
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/command_astext.txt
@@ -0,0 +1,18 @@
+<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
new file mode 100644
index 00000000..5e776238
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/command_asxml.txt
@@ -0,0 +1,38 @@
+<?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/definition_astext.txt b/vendor/symfony/console/Tests/Fixtures/definition_astext.txt
new file mode 100644
index 00000000..0431c072
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/definition_astext.txt
@@ -0,0 +1,11 @@
+<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
new file mode 100644
index 00000000..eec8c079
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/definition_asxml.txt
@@ -0,0 +1,39 @@
+<?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
new file mode 100644
index 00000000..b8173b6b
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_1.json
@@ -0,0 +1 @@
+{"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
new file mode 100644
index 00000000..88f311ab
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_1.md
@@ -0,0 +1,7 @@
+**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_1.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_1.txt
new file mode 100644
index 00000000..55035183
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_1.txt
@@ -0,0 +1 @@
+ <info>argument_name</info>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_1.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_1.xml
new file mode 100644
index 00000000..cb37f812
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_1.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<argument name="argument_name" is_required="1" is_array="0">
+ <description></description>
+ <defaults/>
+</argument>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_2.json b/vendor/symfony/console/Tests/Fixtures/input_argument_2.json
new file mode 100644
index 00000000..ef06b09a
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_2.json
@@ -0,0 +1 @@
+{"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
new file mode 100644
index 00000000..3cdb00cc
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_2.md
@@ -0,0 +1,7 @@
+**argument_name:**
+
+* Name: argument_name
+* Is required: no
+* Is array: yes
+* Description: argument description
+* Default: `array ()`
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_2.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_2.txt
new file mode 100644
index 00000000..e7136607
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_2.txt
@@ -0,0 +1 @@
+ <info>argument_name</info> argument description
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_2.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_2.xml
new file mode 100644
index 00000000..629da5a9
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_2.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<argument name="argument_name" is_required="0" is_array="1">
+ <description>argument description</description>
+ <defaults/>
+</argument>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_3.json b/vendor/symfony/console/Tests/Fixtures/input_argument_3.json
new file mode 100644
index 00000000..de8484e6
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_3.json
@@ -0,0 +1 @@
+{"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
new file mode 100644
index 00000000..be1c443a
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_3.md
@@ -0,0 +1,7 @@
+**argument_name:**
+
+* 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_3.txt b/vendor/symfony/console/Tests/Fixtures/input_argument_3.txt
new file mode 100644
index 00000000..6b76639e
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_3.txt
@@ -0,0 +1 @@
+ <info>argument_name</info> argument description<comment> [default: "default_value"]</comment>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_3.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_3.xml
new file mode 100644
index 00000000..399a5c86
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_3.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>default_value</default>
+ </defaults>
+</argument>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_4.json b/vendor/symfony/console/Tests/Fixtures/input_argument_4.json
new file mode 100644
index 00000000..8067a4d1
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_4.json
@@ -0,0 +1 @@
+{"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
new file mode 100644
index 00000000..f026ab37
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_4.md
@@ -0,0 +1,8 @@
+**argument_name:**
+
+* 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
new file mode 100644
index 00000000..aa74e8ce
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_4.txt
@@ -0,0 +1,2 @@
+ <info>argument_name</info> multiline
+ argument description
diff --git a/vendor/symfony/console/Tests/Fixtures/input_argument_4.xml b/vendor/symfony/console/Tests/Fixtures/input_argument_4.xml
new file mode 100644
index 00000000..5ca135ec
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_argument_4.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<argument name="argument_name" is_required="1" is_array="0">
+ <description>multiline
+argument description</description>
+ <defaults/>
+</argument>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_1.json b/vendor/symfony/console/Tests/Fixtures/input_definition_1.json
new file mode 100644
index 00000000..c7a7d838
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_1.json
@@ -0,0 +1 @@
+{"arguments":[],"options":[]}
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_1.md b/vendor/symfony/console/Tests/Fixtures/input_definition_1.md
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_1.md
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_1.txt b/vendor/symfony/console/Tests/Fixtures/input_definition_1.txt
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_1.txt
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_1.xml b/vendor/symfony/console/Tests/Fixtures/input_definition_1.xml
new file mode 100644
index 00000000..b5481ce1
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_1.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definition>
+ <arguments/>
+ <options/>
+</definition>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_2.json b/vendor/symfony/console/Tests/Fixtures/input_definition_2.json
new file mode 100644
index 00000000..9964a55a
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_2.json
@@ -0,0 +1 @@
+{"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
new file mode 100644
index 00000000..923191cd
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_2.md
@@ -0,0 +1,9 @@
+### Arguments:
+
+**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_2.txt b/vendor/symfony/console/Tests/Fixtures/input_definition_2.txt
new file mode 100644
index 00000000..73b0f308
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_2.txt
@@ -0,0 +1,2 @@
+<comment>Arguments:</comment>
+ <info>argument_name</info>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_2.xml b/vendor/symfony/console/Tests/Fixtures/input_definition_2.xml
new file mode 100644
index 00000000..102efc14
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_2.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definition>
+ <arguments>
+ <argument name="argument_name" is_required="1" is_array="0">
+ <description></description>
+ <defaults/>
+ </argument>
+ </arguments>
+ <options/>
+</definition>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_3.json b/vendor/symfony/console/Tests/Fixtures/input_definition_3.json
new file mode 100644
index 00000000..6a860560
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_3.json
@@ -0,0 +1 @@
+{"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
new file mode 100644
index 00000000..40fd7b0a
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_3.md
@@ -0,0 +1,11 @@
+### Options:
+
+**option_name:**
+
+* 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_3.txt b/vendor/symfony/console/Tests/Fixtures/input_definition_3.txt
new file mode 100644
index 00000000..c02766fd
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_3.txt
@@ -0,0 +1,2 @@
+<comment>Options:</comment>
+ <info>-o, --option_name</info>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_3.xml b/vendor/symfony/console/Tests/Fixtures/input_definition_3.xml
new file mode 100644
index 00000000..bc951515
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_3.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definition>
+ <arguments/>
+ <options>
+ <option name="--option_name" shortcut="-o" accept_value="0" is_value_required="0" is_multiple="0">
+ <description></description>
+ </option>
+ </options>
+</definition>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_4.json b/vendor/symfony/console/Tests/Fixtures/input_definition_4.json
new file mode 100644
index 00000000..c5a0019f
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_4.json
@@ -0,0 +1 @@
+{"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
new file mode 100644
index 00000000..a31feea4
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_4.md
@@ -0,0 +1,21 @@
+### Arguments:
+
+**argument_name:**
+
+* Name: argument_name
+* Is required: yes
+* Is array: no
+* Description: <none>
+* Default: `NULL`
+
+### Options:
+
+**option_name:**
+
+* 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.txt b/vendor/symfony/console/Tests/Fixtures/input_definition_4.txt
new file mode 100644
index 00000000..63aa81d2
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_4.txt
@@ -0,0 +1,5 @@
+<comment>Arguments:</comment>
+ <info>argument_name</info>
+
+<comment>Options:</comment>
+ <info>-o, --option_name</info>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_definition_4.xml b/vendor/symfony/console/Tests/Fixtures/input_definition_4.xml
new file mode 100644
index 00000000..cffceece
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_definition_4.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definition>
+ <arguments>
+ <argument name="argument_name" is_required="1" is_array="0">
+ <description></description>
+ <defaults/>
+ </argument>
+ </arguments>
+ <options>
+ <option name="--option_name" shortcut="-o" accept_value="0" is_value_required="0" is_multiple="0">
+ <description></description>
+ </option>
+ </options>
+</definition>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_1.json b/vendor/symfony/console/Tests/Fixtures/input_option_1.json
new file mode 100644
index 00000000..60c5b56c
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_1.json
@@ -0,0 +1 @@
+{"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
new file mode 100644
index 00000000..6f9e9a7e
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_1.md
@@ -0,0 +1,9 @@
+**option_name:**
+
+* 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.txt b/vendor/symfony/console/Tests/Fixtures/input_option_1.txt
new file mode 100644
index 00000000..3a5e4eed
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_1.txt
@@ -0,0 +1 @@
+ <info>-o, --option_name</info>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_1.xml b/vendor/symfony/console/Tests/Fixtures/input_option_1.xml
new file mode 100644
index 00000000..8a64ea65
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_1.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<option name="--option_name" shortcut="-o" accept_value="0" is_value_required="0" is_multiple="0">
+ <description></description>
+</option>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_2.json b/vendor/symfony/console/Tests/Fixtures/input_option_2.json
new file mode 100644
index 00000000..04e4228e
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_2.json
@@ -0,0 +1 @@
+{"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
new file mode 100644
index 00000000..634ac0b0
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_2.md
@@ -0,0 +1,9 @@
+**option_name:**
+
+* 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_2.txt b/vendor/symfony/console/Tests/Fixtures/input_option_2.txt
new file mode 100644
index 00000000..1009eff1
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_2.txt
@@ -0,0 +1 @@
+ <info>-o, --option_name[=OPTION_NAME]</info> option description<comment> [default: "default_value"]</comment>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_2.xml b/vendor/symfony/console/Tests/Fixtures/input_option_2.xml
new file mode 100644
index 00000000..4afac5b0
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_2.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>default_value</default>
+ </defaults>
+</option>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_3.json b/vendor/symfony/console/Tests/Fixtures/input_option_3.json
new file mode 100644
index 00000000..c1ea120c
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_3.json
@@ -0,0 +1 @@
+{"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
new file mode 100644
index 00000000..34282896
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_3.md
@@ -0,0 +1,9 @@
+**option_name:**
+
+* 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_3.txt b/vendor/symfony/console/Tests/Fixtures/input_option_3.txt
new file mode 100644
index 00000000..947bb652
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_3.txt
@@ -0,0 +1 @@
+ <info>-o, --option_name=OPTION_NAME</info> option description
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_3.xml b/vendor/symfony/console/Tests/Fixtures/input_option_3.xml
new file mode 100644
index 00000000..dcc0631c
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_3.xml
@@ -0,0 +1,5 @@
+<?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/>
+</option>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_4.json b/vendor/symfony/console/Tests/Fixtures/input_option_4.json
new file mode 100644
index 00000000..1b671d80
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_4.json
@@ -0,0 +1 @@
+{"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
new file mode 100644
index 00000000..8ffba56e
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_4.md
@@ -0,0 +1,9 @@
+**option_name:**
+
+* 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_4.txt b/vendor/symfony/console/Tests/Fixtures/input_option_4.txt
new file mode 100644
index 00000000..27edf77b
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_4.txt
@@ -0,0 +1 @@
+ <info>-o, --option_name[=OPTION_NAME]</info> option description<comment> (multiple values allowed)</comment>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_4.xml b/vendor/symfony/console/Tests/Fixtures/input_option_4.xml
new file mode 100644
index 00000000..5e2418b1
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_4.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<option name="--option_name" shortcut="-o" accept_value="1" is_value_required="0" is_multiple="1">
+ <description>option description</description>
+ <defaults/>
+</option>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_5.json b/vendor/symfony/console/Tests/Fixtures/input_option_5.json
new file mode 100644
index 00000000..35a1405f
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_5.json
@@ -0,0 +1 @@
+{"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
new file mode 100644
index 00000000..82f51cad
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_5.md
@@ -0,0 +1,10 @@
+**option_name:**
+
+* 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
new file mode 100644
index 00000000..4368883c
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_5.txt
@@ -0,0 +1,2 @@
+ <info>-o, --option_name=OPTION_NAME</info> multiline
+ option description
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_5.xml b/vendor/symfony/console/Tests/Fixtures/input_option_5.xml
new file mode 100644
index 00000000..90040ccd
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_5.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<option name="--option_name" shortcut="-o" accept_value="1" is_value_required="1" is_multiple="0">
+ <description>multiline
+option description</description>
+ <defaults/>
+</option>
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_6.json b/vendor/symfony/console/Tests/Fixtures/input_option_6.json
new file mode 100644
index 00000000..d84e8721
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_6.json
@@ -0,0 +1 @@
+{"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
new file mode 100644
index 00000000..ed1ea1c8
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_6.md
@@ -0,0 +1,9 @@
+**option_name:**
+
+* 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_6.txt b/vendor/symfony/console/Tests/Fixtures/input_option_6.txt
new file mode 100644
index 00000000..0e6c9759
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_6.txt
@@ -0,0 +1 @@
+ <info>-o|O, --option_name=OPTION_NAME</info> option with multiple shortcuts
diff --git a/vendor/symfony/console/Tests/Fixtures/input_option_6.xml b/vendor/symfony/console/Tests/Fixtures/input_option_6.xml
new file mode 100644
index 00000000..06126a2f
--- /dev/null
+++ b/vendor/symfony/console/Tests/Fixtures/input_option_6.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<option name="--option_name" shortcut="-o" shortcuts="-o|-O" accept_value="1" is_value_required="1" is_multiple="0">
+ <description>option with multiple shortcuts</description>
+ <defaults/>
+</option>
diff --git a/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php b/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php
new file mode 100644
index 00000000..774df268
--- /dev/null
+++ b/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleStackTest.php
@@ -0,0 +1,70 @@
+<?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\Formatter;
+
+use Symfony\Component\Console\Formatter\OutputFormatterStyleStack;
+use Symfony\Component\Console\Formatter\OutputFormatterStyle;
+
+class OutputFormatterStyleStackTest extends \PHPUnit_Framework_TestCase
+{
+ public function testPush()
+ {
+ $stack = new OutputFormatterStyleStack();
+ $stack->push($s1 = new OutputFormatterStyle('white', 'black'));
+ $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue'));
+
+ $this->assertEquals($s2, $stack->getCurrent());
+
+ $stack->push($s3 = new OutputFormatterStyle('green', 'red'));
+
+ $this->assertEquals($s3, $stack->getCurrent());
+ }
+
+ public function testPop()
+ {
+ $stack = new OutputFormatterStyleStack();
+ $stack->push($s1 = new OutputFormatterStyle('white', 'black'));
+ $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue'));
+
+ $this->assertEquals($s2, $stack->pop());
+ $this->assertEquals($s1, $stack->pop());
+ }
+
+ public function testPopEmpty()
+ {
+ $stack = new OutputFormatterStyleStack();
+ $style = new OutputFormatterStyle();
+
+ $this->assertEquals($style, $stack->pop());
+ }
+
+ public function testPopNotLast()
+ {
+ $stack = new OutputFormatterStyleStack();
+ $stack->push($s1 = new OutputFormatterStyle('white', 'black'));
+ $stack->push($s2 = new OutputFormatterStyle('yellow', 'blue'));
+ $stack->push($s3 = new OutputFormatterStyle('green', 'red'));
+
+ $this->assertEquals($s2, $stack->pop($s2));
+ $this->assertEquals($s1, $stack->pop());
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testInvalidPop()
+ {
+ $stack = new OutputFormatterStyleStack();
+ $stack->push(new OutputFormatterStyle('white', 'black'));
+ $stack->pop(new OutputFormatterStyle('yellow', 'blue'));
+ }
+}
diff --git a/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php b/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php
new file mode 100644
index 00000000..0abfb3ce
--- /dev/null
+++ b/vendor/symfony/console/Tests/Formatter/OutputFormatterStyleTest.php
@@ -0,0 +1,99 @@
+<?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\Formatter;
+
+use Symfony\Component\Console\Formatter\OutputFormatterStyle;
+
+class OutputFormatterStyleTest extends \PHPUnit_Framework_TestCase
+{
+ public function testConstructor()
+ {
+ $style = new OutputFormatterStyle('green', 'black', array('bold', 'underscore'));
+ $this->assertEquals("\033[32;40;1;4mfoo\033[39;49;22;24m", $style->apply('foo'));
+
+ $style = new OutputFormatterStyle('red', null, array('blink'));
+ $this->assertEquals("\033[31;5mfoo\033[39;25m", $style->apply('foo'));
+
+ $style = new OutputFormatterStyle(null, 'white');
+ $this->assertEquals("\033[47mfoo\033[49m", $style->apply('foo'));
+ }
+
+ public function testForeground()
+ {
+ $style = new OutputFormatterStyle();
+
+ $style->setForeground('black');
+ $this->assertEquals("\033[30mfoo\033[39m", $style->apply('foo'));
+
+ $style->setForeground('blue');
+ $this->assertEquals("\033[34mfoo\033[39m", $style->apply('foo'));
+
+ $style->setForeground('default');
+ $this->assertEquals("\033[39mfoo\033[39m", $style->apply('foo'));
+
+ $this->setExpectedException('InvalidArgumentException');
+ $style->setForeground('undefined-color');
+ }
+
+ public function testBackground()
+ {
+ $style = new OutputFormatterStyle();
+
+ $style->setBackground('black');
+ $this->assertEquals("\033[40mfoo\033[49m", $style->apply('foo'));
+
+ $style->setBackground('yellow');
+ $this->assertEquals("\033[43mfoo\033[49m", $style->apply('foo'));
+
+ $style->setBackground('default');
+ $this->assertEquals("\033[49mfoo\033[49m", $style->apply('foo'));
+
+ $this->setExpectedException('InvalidArgumentException');
+ $style->setBackground('undefined-color');
+ }
+
+ public function testOptions()
+ {
+ $style = new OutputFormatterStyle();
+
+ $style->setOptions(array('reverse', 'conceal'));
+ $this->assertEquals("\033[7;8mfoo\033[27;28m", $style->apply('foo'));
+
+ $style->setOption('bold');
+ $this->assertEquals("\033[7;8;1mfoo\033[27;28;22m", $style->apply('foo'));
+
+ $style->unsetOption('reverse');
+ $this->assertEquals("\033[8;1mfoo\033[28;22m", $style->apply('foo'));
+
+ $style->setOption('bold');
+ $this->assertEquals("\033[8;1mfoo\033[28;22m", $style->apply('foo'));
+
+ $style->setOptions(array('bold'));
+ $this->assertEquals("\033[1mfoo\033[22m", $style->apply('foo'));
+
+ try {
+ $style->setOption('foo');
+ $this->fail('->setOption() throws an \InvalidArgumentException when the option does not exist in the available options');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('\InvalidArgumentException', $e, '->setOption() throws an \InvalidArgumentException when the option does not exist in the available options');
+ $this->assertContains('Invalid option specified: "foo"', $e->getMessage(), '->setOption() throws an \InvalidArgumentException when the option does not exist in the available options');
+ }
+
+ try {
+ $style->unsetOption('foo');
+ $this->fail('->unsetOption() throws an \InvalidArgumentException when the option does not exist in the available options');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('\InvalidArgumentException', $e, '->unsetOption() throws an \InvalidArgumentException when the option does not exist in the available options');
+ $this->assertContains('Invalid option specified: "foo"', $e->getMessage(), '->unsetOption() throws an \InvalidArgumentException when the option does not exist in the available options');
+ }
+ }
+}
diff --git a/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php b/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php
new file mode 100644
index 00000000..b8d5ca6d
--- /dev/null
+++ b/vendor/symfony/console/Tests/Formatter/OutputFormatterTest.php
@@ -0,0 +1,273 @@
+<?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\Formatter;
+
+use Symfony\Component\Console\Formatter\OutputFormatter;
+use Symfony\Component\Console\Formatter\OutputFormatterStyle;
+
+class OutputFormatterTest extends \PHPUnit_Framework_TestCase
+{
+ public function testEmptyTag()
+ {
+ $formatter = new OutputFormatter(true);
+ $this->assertEquals('foo<>bar', $formatter->format('foo<>bar'));
+ }
+
+ public function testLGCharEscaping()
+ {
+ $formatter = new OutputFormatter(true);
+
+ $this->assertEquals('foo<bar', $formatter->format('foo\\<bar'));
+ $this->assertEquals('<info>some info</info>', $formatter->format('\\<info>some info\\</info>'));
+ $this->assertEquals('\\<info>some info\\</info>', OutputFormatter::escape('<info>some info</info>'));
+
+ $this->assertEquals(
+ "\033[33mSymfony\\Component\\Console does work very well!\033[39m",
+ $formatter->format('<comment>Symfony\Component\Console does work very well!</comment>')
+ );
+ }
+
+ public function testBundledStyles()
+ {
+ $formatter = new OutputFormatter(true);
+
+ $this->assertTrue($formatter->hasStyle('error'));
+ $this->assertTrue($formatter->hasStyle('info'));
+ $this->assertTrue($formatter->hasStyle('comment'));
+ $this->assertTrue($formatter->hasStyle('question'));
+
+ $this->assertEquals(
+ "\033[37;41msome error\033[39;49m",
+ $formatter->format('<error>some error</error>')
+ );
+ $this->assertEquals(
+ "\033[32msome info\033[39m",
+ $formatter->format('<info>some info</info>')
+ );
+ $this->assertEquals(
+ "\033[33msome comment\033[39m",
+ $formatter->format('<comment>some comment</comment>')
+ );
+ $this->assertEquals(
+ "\033[30;46msome question\033[39;49m",
+ $formatter->format('<question>some question</question>')
+ );
+ }
+
+ public function testNestedStyles()
+ {
+ $formatter = new OutputFormatter(true);
+
+ $this->assertEquals(
+ "\033[37;41msome \033[39;49m\033[32msome info\033[39m\033[37;41m error\033[39;49m",
+ $formatter->format('<error>some <info>some info</info> error</error>')
+ );
+ }
+
+ public function testAdjacentStyles()
+ {
+ $formatter = new OutputFormatter(true);
+
+ $this->assertEquals(
+ "\033[37;41msome error\033[39;49m\033[32msome info\033[39m",
+ $formatter->format('<error>some error</error><info>some info</info>')
+ );
+ }
+
+ public function testStyleMatchingNotGreedy()
+ {
+ $formatter = new OutputFormatter(true);
+
+ $this->assertEquals(
+ "(\033[32m>=2.0,<2.3\033[39m)",
+ $formatter->format('(<info>>=2.0,<2.3</info>)')
+ );
+ }
+
+ public function testStyleEscaping()
+ {
+ $formatter = new OutputFormatter(true);
+
+ $this->assertEquals(
+ "(\033[32mz>=2.0,<<<a2.3\\\033[39m)",
+ $formatter->format('(<info>'.$formatter->escape('z>=2.0,<\\<<a2.3\\').'</info>)')
+ );
+
+ $this->assertEquals(
+ "\033[32m<error>some error</error>\033[39m",
+ $formatter->format('<info>'.$formatter->escape('<error>some error</error>').'</info>')
+ );
+ }
+
+ public function testDeepNestedStyles()
+ {
+ $formatter = new OutputFormatter(true);
+
+ $this->assertEquals(
+ "\033[37;41merror\033[39;49m\033[32minfo\033[39m\033[33mcomment\033[39m\033[37;41merror\033[39;49m",
+ $formatter->format('<error>error<info>info<comment>comment</info>error</error>')
+ );
+ }
+
+ public function testNewStyle()
+ {
+ $formatter = new OutputFormatter(true);
+
+ $style = new OutputFormatterStyle('blue', 'white');
+ $formatter->setStyle('test', $style);
+
+ $this->assertEquals($style, $formatter->getStyle('test'));
+ $this->assertNotEquals($style, $formatter->getStyle('info'));
+
+ $style = new OutputFormatterStyle('blue', 'white');
+ $formatter->setStyle('b', $style);
+
+ $this->assertEquals("\033[34;47msome \033[39;49m\033[34;47mcustom\033[39;49m\033[34;47m msg\033[39;49m", $formatter->format('<test>some <b>custom</b> msg</test>'));
+ }
+
+ public function testRedefineStyle()
+ {
+ $formatter = new OutputFormatter(true);
+
+ $style = new OutputFormatterStyle('blue', 'white');
+ $formatter->setStyle('info', $style);
+
+ $this->assertEquals("\033[34;47msome custom msg\033[39;49m", $formatter->format('<info>some custom msg</info>'));
+ }
+
+ public function testInlineStyle()
+ {
+ $formatter = new OutputFormatter(true);
+
+ $this->assertEquals("\033[34;41msome text\033[39;49m", $formatter->format('<fg=blue;bg=red>some text</>'));
+ $this->assertEquals("\033[34;41msome text\033[39;49m", $formatter->format('<fg=blue;bg=red>some text</fg=blue;bg=red>'));
+ }
+
+ public function testNonStyleTag()
+ {
+ $formatter = new OutputFormatter(true);
+
+ $this->assertEquals("\033[32msome \033[39m\033[32m<tag>\033[39m\033[32m \033[39m\033[32m<setting=value>\033[39m\033[32m styled \033[39m\033[32m<p>\033[39m\033[32msingle-char tag\033[39m\033[32m</p>\033[39m", $formatter->format('<info>some <tag> <setting=value> styled <p>single-char tag</p></info>'));
+ }
+
+ public function testFormatLongString()
+ {
+ $formatter = new OutputFormatter(true);
+ $long = str_repeat('\\', 14000);
+ $this->assertEquals("\033[37;41msome error\033[39;49m".$long, $formatter->format('<error>some error</error>'.$long));
+ }
+
+ public function testFormatToStringObject()
+ {
+ $formatter = new OutputFormatter(false);
+ $this->assertEquals(
+ 'some info', $formatter->format(new TableCell())
+ );
+ }
+
+ public function testNotDecoratedFormatter()
+ {
+ $formatter = new OutputFormatter(false);
+
+ $this->assertTrue($formatter->hasStyle('error'));
+ $this->assertTrue($formatter->hasStyle('info'));
+ $this->assertTrue($formatter->hasStyle('comment'));
+ $this->assertTrue($formatter->hasStyle('question'));
+
+ $this->assertEquals(
+ 'some error', $formatter->format('<error>some error</error>')
+ );
+ $this->assertEquals(
+ 'some info', $formatter->format('<info>some info</info>')
+ );
+ $this->assertEquals(
+ 'some comment', $formatter->format('<comment>some comment</comment>')
+ );
+ $this->assertEquals(
+ 'some question', $formatter->format('<question>some question</question>')
+ );
+
+ $formatter->setDecorated(true);
+
+ $this->assertEquals(
+ "\033[37;41msome error\033[39;49m", $formatter->format('<error>some error</error>')
+ );
+ $this->assertEquals(
+ "\033[32msome info\033[39m", $formatter->format('<info>some info</info>')
+ );
+ $this->assertEquals(
+ "\033[33msome comment\033[39m", $formatter->format('<comment>some comment</comment>')
+ );
+ $this->assertEquals(
+ "\033[30;46msome question\033[39;49m", $formatter->format('<question>some question</question>')
+ );
+ }
+
+ public function testContentWithLineBreaks()
+ {
+ $formatter = new OutputFormatter(true);
+
+ $this->assertEquals(<<<EOF
+\033[32m
+some text\033[39m
+EOF
+ , $formatter->format(<<<'EOF'
+<info>
+some text</info>
+EOF
+ ));
+
+ $this->assertEquals(<<<EOF
+\033[32msome text
+\033[39m
+EOF
+ , $formatter->format(<<<'EOF'
+<info>some text
+</info>
+EOF
+ ));
+
+ $this->assertEquals(<<<EOF
+\033[32m
+some text
+\033[39m
+EOF
+ , $formatter->format(<<<'EOF'
+<info>
+some text
+</info>
+EOF
+ ));
+
+ $this->assertEquals(<<<EOF
+\033[32m
+some text
+more text
+\033[39m
+EOF
+ , $formatter->format(<<<'EOF'
+<info>
+some text
+more text
+</info>
+EOF
+ ));
+ }
+}
+
+class TableCell
+{
+ public function __toString()
+ {
+ return '<info>some info</info>';
+ }
+}
diff --git a/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php b/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php
new file mode 100644
index 00000000..e0aa9211
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/FormatterHelperTest.php
@@ -0,0 +1,92 @@
+<?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\FormatterHelper;
+
+class FormatterHelperTest extends \PHPUnit_Framework_TestCase
+{
+ public function testFormatSection()
+ {
+ $formatter = new FormatterHelper();
+
+ $this->assertEquals(
+ '<info>[cli]</info> Some text to display',
+ $formatter->formatSection('cli', 'Some text to display'),
+ '::formatSection() formats a message in a section'
+ );
+ }
+
+ public function testFormatBlock()
+ {
+ $formatter = new FormatterHelper();
+
+ $this->assertEquals(
+ '<error> Some text to display </error>',
+ $formatter->formatBlock('Some text to display', 'error'),
+ '::formatBlock() formats a message in a block'
+ );
+
+ $this->assertEquals(
+ '<error> Some text to display </error>'."\n".
+ '<error> foo bar </error>',
+ $formatter->formatBlock(array('Some text to display', 'foo bar'), 'error'),
+ '::formatBlock() formats a message in a block'
+ );
+
+ $this->assertEquals(
+ '<error> </error>'."\n".
+ '<error> Some text to display </error>'."\n".
+ '<error> </error>',
+ $formatter->formatBlock('Some text to display', 'error', true),
+ '::formatBlock() formats a message in a block'
+ );
+ }
+
+ public function testFormatBlockWithDiacriticLetters()
+ {
+ $formatter = new FormatterHelper();
+
+ $this->assertEquals(
+ '<error> </error>'."\n".
+ '<error> Du texte à afficher </error>'."\n".
+ '<error> </error>',
+ $formatter->formatBlock('Du texte à afficher', 'error', true),
+ '::formatBlock() formats a message in a block'
+ );
+ }
+
+ public function testFormatBlockWithDoubleWidthDiacriticLetters()
+ {
+ $formatter = new FormatterHelper();
+ $this->assertEquals(
+ '<error> </error>'."\n".
+ '<error> 表示するテキスト </error>'."\n".
+ '<error> </error>',
+ $formatter->formatBlock('表示するテキスト', 'error', true),
+ '::formatBlock() formats a message in a block'
+ );
+ }
+
+ public function testFormatBlockLGEscaping()
+ {
+ $formatter = new FormatterHelper();
+
+ $this->assertEquals(
+ '<error> </error>'."\n".
+ '<error> \<info>some info\</info> </error>'."\n".
+ '<error> </error>',
+ $formatter->formatBlock('<info>some info</info>', 'error', true),
+ '::formatBlock() escapes \'<\' chars'
+ );
+ }
+}
diff --git a/vendor/symfony/console/Tests/Helper/HelperSetTest.php b/vendor/symfony/console/Tests/Helper/HelperSetTest.php
new file mode 100644
index 00000000..04edd304
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/HelperSetTest.php
@@ -0,0 +1,133 @@
+<?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\HelperSet;
+use Symfony\Component\Console\Command\Command;
+
+class HelperSetTest extends \PHPUnit_Framework_TestCase
+{
+ public function testConstructor()
+ {
+ $mock_helper = $this->getGenericMockHelper('fake_helper');
+ $helperset = new HelperSet(array('fake_helper_alias' => $mock_helper));
+
+ $this->assertEquals($mock_helper, $helperset->get('fake_helper_alias'), '__construct sets given helper to helpers');
+ $this->assertTrue($helperset->has('fake_helper_alias'), '__construct sets helper alias for given helper');
+ }
+
+ public function testSet()
+ {
+ $helperset = new HelperSet();
+ $helperset->set($this->getGenericMockHelper('fake_helper', $helperset));
+ $this->assertTrue($helperset->has('fake_helper'), '->set() adds helper to helpers');
+
+ $helperset = new HelperSet();
+ $helperset->set($this->getGenericMockHelper('fake_helper_01', $helperset));
+ $helperset->set($this->getGenericMockHelper('fake_helper_02', $helperset));
+ $this->assertTrue($helperset->has('fake_helper_01'), '->set() will set multiple helpers on consecutive calls');
+ $this->assertTrue($helperset->has('fake_helper_02'), '->set() will set multiple helpers on consecutive calls');
+
+ $helperset = new HelperSet();
+ $helperset->set($this->getGenericMockHelper('fake_helper', $helperset), 'fake_helper_alias');
+ $this->assertTrue($helperset->has('fake_helper'), '->set() adds helper alias when set');
+ $this->assertTrue($helperset->has('fake_helper_alias'), '->set() adds helper alias when set');
+ }
+
+ public function testHas()
+ {
+ $helperset = new HelperSet(array('fake_helper_alias' => $this->getGenericMockHelper('fake_helper')));
+ $this->assertTrue($helperset->has('fake_helper'), '->has() finds set helper');
+ $this->assertTrue($helperset->has('fake_helper_alias'), '->has() finds set helper by alias');
+ }
+
+ public function testGet()
+ {
+ $helper_01 = $this->getGenericMockHelper('fake_helper_01');
+ $helper_02 = $this->getGenericMockHelper('fake_helper_02');
+ $helperset = new HelperSet(array('fake_helper_01_alias' => $helper_01, 'fake_helper_02_alias' => $helper_02));
+ $this->assertEquals($helper_01, $helperset->get('fake_helper_01'), '->get() returns correct helper by name');
+ $this->assertEquals($helper_01, $helperset->get('fake_helper_01_alias'), '->get() returns correct helper by alias');
+ $this->assertEquals($helper_02, $helperset->get('fake_helper_02'), '->get() returns correct helper by name');
+ $this->assertEquals($helper_02, $helperset->get('fake_helper_02_alias'), '->get() returns correct helper by alias');
+
+ $helperset = new HelperSet();
+ try {
+ $helperset->get('foo');
+ $this->fail('->get() throws InvalidArgumentException when helper not found');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('\InvalidArgumentException', $e, '->get() throws InvalidArgumentException when helper not found');
+ $this->assertInstanceOf('Symfony\Component\Console\Exception\ExceptionInterface', $e, '->get() throws domain specific exception when helper not found');
+ $this->assertContains('The helper "foo" is not defined.', $e->getMessage(), '->get() throws InvalidArgumentException when helper not found');
+ }
+ }
+
+ public function testSetCommand()
+ {
+ $cmd_01 = new Command('foo');
+ $cmd_02 = new Command('bar');
+
+ $helperset = new HelperSet();
+ $helperset->setCommand($cmd_01);
+ $this->assertEquals($cmd_01, $helperset->getCommand(), '->setCommand() stores given command');
+
+ $helperset = new HelperSet();
+ $helperset->setCommand($cmd_01);
+ $helperset->setCommand($cmd_02);
+ $this->assertEquals($cmd_02, $helperset->getCommand(), '->setCommand() overwrites stored command with consecutive calls');
+ }
+
+ public function testGetCommand()
+ {
+ $cmd = new Command('foo');
+ $helperset = new HelperSet();
+ $helperset->setCommand($cmd);
+ $this->assertEquals($cmd, $helperset->getCommand(), '->getCommand() retrieves stored command');
+ }
+
+ public function testIteration()
+ {
+ $helperset = new HelperSet();
+ $helperset->set($this->getGenericMockHelper('fake_helper_01', $helperset));
+ $helperset->set($this->getGenericMockHelper('fake_helper_02', $helperset));
+
+ $helpers = array('fake_helper_01', 'fake_helper_02');
+ $i = 0;
+
+ foreach ($helperset as $helper) {
+ $this->assertEquals($helpers[$i++], $helper->getName());
+ }
+ }
+
+ /**
+ * 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->expects($this->any())
+ ->method('getName')
+ ->will($this->returnValue($name));
+
+ if ($helperset) {
+ $mock_helper->expects($this->any())
+ ->method('setHelperSet')
+ ->with($this->equalTo($helperset));
+ }
+
+ return $mock_helper;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Helper/HelperTest.php b/vendor/symfony/console/Tests/Helper/HelperTest.php
new file mode 100644
index 00000000..33fa2205
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/HelperTest.php
@@ -0,0 +1,54 @@
+<?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\Helper;
+
+class HelperTest extends \PHPUnit_Framework_TestCase
+{
+ public function formatTimeProvider()
+ {
+ return array(
+ array(0, '< 1 sec'),
+ array(1, '1 sec'),
+ array(2, '2 secs'),
+ array(59, '59 secs'),
+ array(60, '1 min'),
+ array(61, '1 min'),
+ array(119, '1 min'),
+ array(120, '2 mins'),
+ array(121, '2 mins'),
+ array(3599, '59 mins'),
+ array(3600, '1 hr'),
+ array(7199, '1 hr'),
+ array(7200, '2 hrs'),
+ array(7201, '2 hrs'),
+ array(86399, '23 hrs'),
+ array(86400, '1 day'),
+ array(86401, '1 day'),
+ array(172799, '1 day'),
+ array(172800, '2 days'),
+ array(172801, '2 days'),
+ );
+ }
+
+ /**
+ * @dataProvider formatTimeProvider
+ *
+ * @param int $secs
+ * @param string $expectedFormat
+ */
+ public function testFormatTime($secs, $expectedFormat)
+ {
+ $this->assertEquals($expectedFormat, Helper::formatTime($secs));
+ }
+}
diff --git a/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php b/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php
new file mode 100644
index 00000000..97bf7756
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/LegacyDialogHelperTest.php
@@ -0,0 +1,263 @@
+<?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
new file mode 100644
index 00000000..f835a71e
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php
@@ -0,0 +1,224 @@
+<?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
new file mode 100644
index 00000000..557dc14f
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php
@@ -0,0 +1,316 @@
+<?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
new file mode 100644
index 00000000..a51fb435
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/ProcessHelperTest.php
@@ -0,0 +1,117 @@
+<?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\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
+{
+ /**
+ * @dataProvider provideCommandsAndOutput
+ */
+ public function testVariousProcessRuns($expected, $cmd, $verbosity, $error)
+ {
+ $helper = new ProcessHelper();
+ $helper->setHelperSet(new HelperSet(array(new DebugFormatterHelper())));
+ $output = $this->getOutputStream($verbosity);
+ $helper->run($output, $cmd, $error);
+ $this->assertEquals($expected, $this->getOutput($output));
+ }
+
+ public function testPassedCallbackIsExecuted()
+ {
+ $helper = new ProcessHelper();
+ $helper->setHelperSet(new HelperSet(array(new DebugFormatterHelper())));
+ $output = $this->getOutputStream(StreamOutput::VERBOSITY_NORMAL);
+
+ $executed = false;
+ $callback = function () use (&$executed) { $executed = true; };
+
+ $helper->run($output, 'php -r "echo 42;"', null, $callback);
+ $this->assertTrue($executed);
+ }
+
+ public function provideCommandsAndOutput()
+ {
+ $successOutputVerbose = <<<EOT
+ RUN php -r "echo 42;"
+ RES Command ran successfully
+
+EOT;
+ $successOutputDebug = <<<EOT
+ RUN php -r "echo 42;"
+ OUT 42
+ RES Command ran successfully
+
+EOT;
+ $successOutputDebugWithTags = <<<EOT
+ RUN php -r "echo '<info>42</info>';"
+ OUT <info>42</info>
+ RES Command ran successfully
+
+EOT;
+ $successOutputProcessDebug = <<<EOT
+ RUN 'php' '-r' 'echo 42;'
+ OUT 42
+ RES Command ran successfully
+
+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
+ RUN php -r "fwrite(STDERR, 'error message');usleep(500000);fwrite(STDOUT, 'out message');exit(252);"
+ ERR error message
+ OUT out message
+ RES 252 Command did not run successfully
+
+EOT;
+
+ $errorMessage = 'An error occurred';
+ if ('\\' === DIRECTORY_SEPARATOR) {
+ $successOutputProcessDebug = str_replace("'", '"', $successOutputProcessDebug);
+ }
+
+ return array(
+ array('', 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERBOSE, null),
+ array($successOutputVerbose, 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERY_VERBOSE, null),
+ array($successOutputDebug, 'php -r "echo 42;"', StreamOutput::VERBOSITY_DEBUG, null),
+ array($successOutputDebugWithTags, 'php -r "echo \'<info>42</info>\';"', StreamOutput::VERBOSITY_DEBUG, null),
+ array('', 'php -r "syntax error"', StreamOutput::VERBOSITY_VERBOSE, null),
+ array($syntaxErrorOutputVerbose, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERY_VERBOSE, null),
+ array($syntaxErrorOutputDebug, 'php -r "fwrite(STDERR, \'error message\');usleep(500000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_DEBUG, null),
+ array($errorMessage.PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERBOSE, $errorMessage),
+ array($syntaxErrorOutputVerbose.$errorMessage.PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_VERY_VERBOSE, $errorMessage),
+ array($syntaxErrorOutputDebug.$errorMessage.PHP_EOL, 'php -r "fwrite(STDERR, \'error message\');usleep(500000);fwrite(STDOUT, \'out message\');exit(252);"', StreamOutput::VERBOSITY_DEBUG, $errorMessage),
+ array($successOutputProcessDebug, array('php', '-r', 'echo 42;'), StreamOutput::VERBOSITY_DEBUG, null),
+ array($successOutputDebug, new Process('php -r "echo 42;"'), StreamOutput::VERBOSITY_DEBUG, null),
+ );
+ }
+
+ private function getOutputStream($verbosity)
+ {
+ return new StreamOutput(fopen('php://memory', 'r+', false), $verbosity, false);
+ }
+
+ private function getOutput(StreamOutput $output)
+ {
+ rewind($output->getStream());
+
+ return stream_get_contents($output->getStream());
+ }
+}
diff --git a/vendor/symfony/console/Tests/Helper/ProgressBarTest.php b/vendor/symfony/console/Tests/Helper/ProgressBarTest.php
new file mode 100644
index 00000000..261908b5
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/ProgressBarTest.php
@@ -0,0 +1,664 @@
+<?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\ProgressBar;
+use Symfony\Component\Console\Helper\Helper;
+use Symfony\Component\Console\Output\StreamOutput;
+
+/**
+ * @group time-sensitive
+ */
+class ProgressBarTest extends \PHPUnit_Framework_TestCase
+{
+ public function testMultipleStart()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream());
+ $bar->start();
+ $bar->advance();
+ $bar->start();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0 [>---------------------------]').
+ $this->generateOutput(' 1 [->--------------------------]').
+ $this->generateOutput(' 0 [>---------------------------]'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testAdvance()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream());
+ $bar->start();
+ $bar->advance();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0 [>---------------------------]').
+ $this->generateOutput(' 1 [->--------------------------]'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testAdvanceWithStep()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream());
+ $bar->start();
+ $bar->advance(5);
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0 [>---------------------------]').
+ $this->generateOutput(' 5 [----->----------------------]'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testAdvanceMultipleTimes()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream());
+ $bar->start();
+ $bar->advance(3);
+ $bar->advance(2);
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0 [>---------------------------]').
+ $this->generateOutput(' 3 [--->------------------------]').
+ $this->generateOutput(' 5 [----->----------------------]'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testAdvanceOverMax()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(), 10);
+ $bar->setProgress(9);
+ $bar->advance();
+ $bar->advance();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 9/10 [=========================>--] 90%').
+ $this->generateOutput(' 10/10 [============================] 100%').
+ $this->generateOutput(' 11/11 [============================] 100%'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testFormat()
+ {
+ $expected =
+ $this->generateOutput(' 0/10 [>---------------------------] 0%').
+ $this->generateOutput(' 10/10 [============================] 100%').
+ $this->generateOutput(' 10/10 [============================] 100%')
+ ;
+
+ // max in construct, no format
+ $bar = new ProgressBar($output = $this->getOutputStream(), 10);
+ $bar->start();
+ $bar->advance(10);
+ $bar->finish();
+
+ rewind($output->getStream());
+ $this->assertEquals($expected, stream_get_contents($output->getStream()));
+
+ // max in start, no format
+ $bar = new ProgressBar($output = $this->getOutputStream());
+ $bar->start(10);
+ $bar->advance(10);
+ $bar->finish();
+
+ rewind($output->getStream());
+ $this->assertEquals($expected, stream_get_contents($output->getStream()));
+
+ // max in construct, explicit format before
+ $bar = new ProgressBar($output = $this->getOutputStream(), 10);
+ $bar->setFormat('normal');
+ $bar->start();
+ $bar->advance(10);
+ $bar->finish();
+
+ rewind($output->getStream());
+ $this->assertEquals($expected, stream_get_contents($output->getStream()));
+
+ // max in start, explicit format before
+ $bar = new ProgressBar($output = $this->getOutputStream());
+ $bar->setFormat('normal');
+ $bar->start(10);
+ $bar->advance(10);
+ $bar->finish();
+
+ rewind($output->getStream());
+ $this->assertEquals($expected, stream_get_contents($output->getStream()));
+ }
+
+ public function testCustomizations()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(), 10);
+ $bar->setBarWidth(10);
+ $bar->setBarCharacter('_');
+ $bar->setEmptyBarCharacter(' ');
+ $bar->setProgressCharacter('/');
+ $bar->setFormat(' %current%/%max% [%bar%] %percent:3s%%');
+ $bar->start();
+ $bar->advance();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0/10 [/ ] 0%').
+ $this->generateOutput(' 1/10 [_/ ] 10%'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testDisplayWithoutStart()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(), 50);
+ $bar->display();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0/50 [>---------------------------] 0%'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testDisplayWithQuietVerbosity()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(true, StreamOutput::VERBOSITY_QUIET), 50);
+ $bar->display();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ '',
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testFinishWithoutStart()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(), 50);
+ $bar->finish();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 50/50 [============================] 100%'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testPercent()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(), 50);
+ $bar->start();
+ $bar->display();
+ $bar->advance();
+ $bar->advance();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0/50 [>---------------------------] 0%').
+ $this->generateOutput(' 0/50 [>---------------------------] 0%').
+ $this->generateOutput(' 1/50 [>---------------------------] 2%').
+ $this->generateOutput(' 2/50 [=>--------------------------] 4%'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testOverwriteWithShorterLine()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(), 50);
+ $bar->setFormat(' %current%/%max% [%bar%] %percent:3s%%');
+ $bar->start();
+ $bar->display();
+ $bar->advance();
+
+ // set shorter format
+ $bar->setFormat(' %current%/%max% [%bar%]');
+ $bar->advance();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0/50 [>---------------------------] 0%').
+ $this->generateOutput(' 0/50 [>---------------------------] 0%').
+ $this->generateOutput(' 1/50 [>---------------------------] 2%').
+ $this->generateOutput(' 2/50 [=>--------------------------]'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testStartWithMax()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream());
+ $bar->setFormat('%current%/%max% [%bar%]');
+ $bar->start(50);
+ $bar->advance();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0/50 [>---------------------------]').
+ $this->generateOutput(' 1/50 [>---------------------------]'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testSetCurrentProgress()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(), 50);
+ $bar->start();
+ $bar->display();
+ $bar->advance();
+ $bar->setProgress(15);
+ $bar->setProgress(25);
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0/50 [>---------------------------] 0%').
+ $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())
+ );
+ }
+
+ /**
+ */
+ public function testSetCurrentBeforeStarting()
+ {
+ $bar = new ProgressBar($this->getOutputStream());
+ $bar->setProgress(15);
+ $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->setRedrawFrequency(2);
+ $bar->start();
+ $bar->setProgress(1);
+ $bar->advance(2);
+ $bar->advance(2);
+ $bar->advance(1);
+ }
+
+ public function testRedrawFrequencyIsAtLeastOneIfZeroGiven()
+ {
+ $bar = $this->getMock('Symfony\Component\Console\Helper\ProgressBar', array('display'), array($this->getOutputStream()));
+
+ $bar->expects($this->exactly(2))->method('display');
+ $bar->setRedrawFrequency(0);
+ $bar->start();
+ $bar->advance();
+ }
+
+ public function testRedrawFrequencyIsAtLeastOneIfSmallerOneGiven()
+ {
+ $bar = $this->getMock('Symfony\Component\Console\Helper\ProgressBar', array('display'), array($this->getOutputStream()));
+
+ $bar->expects($this->exactly(2))->method('display');
+ $bar->setRedrawFrequency(0.9);
+ $bar->start();
+ $bar->advance();
+ }
+
+ public function testMultiByteSupport()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream());
+ $bar->start();
+ $bar->setBarCharacter('■');
+ $bar->advance(3);
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0 [>---------------------------]').
+ $this->generateOutput(' 3 [■■■>------------------------]'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testClear()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(), 50);
+ $bar->start();
+ $bar->setProgress(25);
+ $bar->clear();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0/50 [>---------------------------] 0%').
+ $this->generateOutput(' 25/50 [==============>-------------] 50%').
+ $this->generateOutput(''),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testPercentNotHundredBeforeComplete()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(), 200);
+ $bar->start();
+ $bar->display();
+ $bar->advance(199);
+ $bar->advance();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0/200 [>---------------------------] 0%').
+ $this->generateOutput(' 0/200 [>---------------------------] 0%').
+ $this->generateOutput(' 199/200 [===========================>] 99%').
+ $this->generateOutput(' 200/200 [============================] 100%'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testNonDecoratedOutput()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(false), 200);
+ $bar->start();
+
+ for ($i = 0; $i < 200; ++$i) {
+ $bar->advance();
+ }
+
+ $bar->finish();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ ' 0/200 [>---------------------------] 0%'.PHP_EOL.
+ ' 20/200 [==>-------------------------] 10%'.PHP_EOL.
+ ' 40/200 [=====>----------------------] 20%'.PHP_EOL.
+ ' 60/200 [========>-------------------] 30%'.PHP_EOL.
+ ' 80/200 [===========>----------------] 40%'.PHP_EOL.
+ ' 100/200 [==============>-------------] 50%'.PHP_EOL.
+ ' 120/200 [================>-----------] 60%'.PHP_EOL.
+ ' 140/200 [===================>--------] 70%'.PHP_EOL.
+ ' 160/200 [======================>-----] 80%'.PHP_EOL.
+ ' 180/200 [=========================>--] 90%'.PHP_EOL.
+ ' 200/200 [============================] 100%',
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testNonDecoratedOutputWithClear()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(false), 50);
+ $bar->start();
+ $bar->setProgress(25);
+ $bar->clear();
+ $bar->setProgress(50);
+ $bar->finish();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ ' 0/50 [>---------------------------] 0%'.PHP_EOL.
+ ' 25/50 [==============>-------------] 50%'.PHP_EOL.
+ ' 50/50 [============================] 100%',
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testNonDecoratedOutputWithoutMax()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(false));
+ $bar->start();
+ $bar->advance();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ ' 0 [>---------------------------]'.PHP_EOL.
+ ' 1 [->--------------------------]',
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testParallelBars()
+ {
+ $output = $this->getOutputStream();
+ $bar1 = new ProgressBar($output, 2);
+ $bar2 = new ProgressBar($output, 3);
+ $bar2->setProgressCharacter('#');
+ $bar3 = new ProgressBar($output);
+
+ $bar1->start();
+ $output->write("\n");
+ $bar2->start();
+ $output->write("\n");
+ $bar3->start();
+
+ for ($i = 1; $i <= 3; ++$i) {
+ // up two lines
+ $output->write("\033[2A");
+ if ($i <= 2) {
+ $bar1->advance();
+ }
+ $output->write("\n");
+ $bar2->advance();
+ $output->write("\n");
+ $bar3->advance();
+ }
+ $output->write("\033[2A");
+ $output->write("\n");
+ $output->write("\n");
+ $bar3->finish();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0/2 [>---------------------------] 0%')."\n".
+ $this->generateOutput(' 0/3 [#---------------------------] 0%')."\n".
+ rtrim($this->generateOutput(' 0 [>---------------------------]')).
+
+ "\033[2A".
+ $this->generateOutput(' 1/2 [==============>-------------] 50%')."\n".
+ $this->generateOutput(' 1/3 [=========#------------------] 33%')."\n".
+ rtrim($this->generateOutput(' 1 [->--------------------------]')).
+
+ "\033[2A".
+ $this->generateOutput(' 2/2 [============================] 100%')."\n".
+ $this->generateOutput(' 2/3 [==================#---------] 66%')."\n".
+ rtrim($this->generateOutput(' 2 [-->-------------------------]')).
+
+ "\033[2A".
+ "\n".
+ $this->generateOutput(' 3/3 [============================] 100%')."\n".
+ rtrim($this->generateOutput(' 3 [--->------------------------]')).
+
+ "\033[2A".
+ "\n".
+ "\n".
+ rtrim($this->generateOutput(' 3 [============================]')),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testWithoutMax()
+ {
+ $output = $this->getOutputStream();
+
+ $bar = new ProgressBar($output);
+ $bar->start();
+ $bar->advance();
+ $bar->advance();
+ $bar->advance();
+ $bar->finish();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ rtrim($this->generateOutput(' 0 [>---------------------------]')).
+ rtrim($this->generateOutput(' 1 [->--------------------------]')).
+ rtrim($this->generateOutput(' 2 [-->-------------------------]')).
+ rtrim($this->generateOutput(' 3 [--->------------------------]')).
+ rtrim($this->generateOutput(' 3 [============================]')),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testAddingPlaceholderFormatter()
+ {
+ ProgressBar::setPlaceholderFormatterDefinition('remaining_steps', function (ProgressBar $bar) {
+ return $bar->getMaxSteps() - $bar->getProgress();
+ });
+ $bar = new ProgressBar($output = $this->getOutputStream(), 3);
+ $bar->setFormat(' %remaining_steps% [%bar%]');
+
+ $bar->start();
+ $bar->advance();
+ $bar->finish();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 3 [>---------------------------]').
+ $this->generateOutput(' 2 [=========>------------------]').
+ $this->generateOutput(' 0 [============================]'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testMultilineFormat()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(), 3);
+ $bar->setFormat("%bar%\nfoobar");
+
+ $bar->start();
+ $bar->advance();
+ $bar->clear();
+ $bar->finish();
+
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(">---------------------------\nfoobar").
+ $this->generateOutput("=========>------------------\nfoobar").
+ "\x0D\x1B[2K\x1B[1A\x1B[2K".
+ $this->generateOutput("============================\nfoobar"),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testAnsiColorsAndEmojis()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream(), 15);
+ ProgressBar::setPlaceholderFormatterDefinition('memory', function (ProgressBar $bar) {
+ static $i = 0;
+ $mem = 100000 * $i;
+ $colors = $i++ ? '41;37' : '44;37';
+
+ return "\033[".$colors.'m '.Helper::formatMemory($mem)." \033[0m";
+ });
+ $bar->setFormat(" \033[44;37m %title:-37s% \033[0m\n %current%/%max% %bar% %percent:3s%%\n 🏁 %remaining:-10s% %memory:37s%");
+ $bar->setBarCharacter($done = "\033[32m●\033[0m");
+ $bar->setEmptyBarCharacter($empty = "\033[31m●\033[0m");
+ $bar->setProgressCharacter($progress = "\033[32m➤ \033[0m");
+
+ $bar->setMessage('Starting the demo... fingers crossed', 'title');
+ $bar->start();
+ $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"
+ ).
+ $this->generateOutput(
+ " \033[44;37m Thanks, bye \033[0m\n".
+ ' 15/15 '.str_repeat($done, 28)." 100%\n".
+ " \xf0\x9f\x8f\x81 < 1 sec \033[41;37m 195 KiB \033[0m"
+ ),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testSetFormat()
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream());
+ $bar->setFormat('normal');
+ $bar->start();
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0 [>---------------------------]'),
+ stream_get_contents($output->getStream())
+ );
+
+ $bar = new ProgressBar($output = $this->getOutputStream(), 10);
+ $bar->setFormat('normal');
+ $bar->start();
+ rewind($output->getStream());
+ $this->assertEquals(
+ $this->generateOutput(' 0/10 [>---------------------------] 0%'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ /**
+ * @dataProvider provideFormat
+ */
+ public function testFormatsWithoutMax($format)
+ {
+ $bar = new ProgressBar($output = $this->getOutputStream());
+ $bar->setFormat($format);
+ $bar->start();
+
+ rewind($output->getStream());
+ $this->assertNotEmpty(stream_get_contents($output->getStream()));
+ }
+
+ /**
+ * Provides each defined format.
+ *
+ * @return array
+ */
+ public function provideFormat()
+ {
+ return array(
+ array('normal'),
+ array('verbose'),
+ array('very_verbose'),
+ array('debug'),
+ );
+ }
+
+ protected function getOutputStream($decorated = true, $verbosity = StreamOutput::VERBOSITY_NORMAL)
+ {
+ return new StreamOutput(fopen('php://memory', 'r+', false), $verbosity, $decorated);
+ }
+
+ protected function generateOutput($expected)
+ {
+ $count = substr_count($expected, "\n");
+
+ return "\x0D\x1B[2K".($count ? str_repeat("\x1B[1A\x1B[2K", $count) : '').$expected;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php b/vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php
new file mode 100644
index 00000000..19262526
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/ProgressIndicatorTest.php
@@ -0,0 +1,182 @@
+<?php
+
+namespace Symfony\Component\Console\Tests\Helper;
+
+use Symfony\Component\Console\Helper\ProgressIndicator;
+use Symfony\Component\Console\Output\StreamOutput;
+
+/**
+ * @group time-sensitive
+ */
+class ProgressIndicatorTest extends \PHPUnit_Framework_TestCase
+{
+ public function testDefaultIndicator()
+ {
+ $bar = new ProgressIndicator($output = $this->getOutputStream());
+ $bar->start('Starting...');
+ usleep(101000);
+ $bar->advance();
+ usleep(101000);
+ $bar->advance();
+ usleep(101000);
+ $bar->advance();
+ usleep(101000);
+ $bar->advance();
+ usleep(101000);
+ $bar->advance();
+ usleep(101000);
+ $bar->setMessage('Advancing...');
+ $bar->advance();
+ $bar->finish('Done...');
+ $bar->start('Starting Again...');
+ usleep(101000);
+ $bar->advance();
+ $bar->finish('Done Again...');
+
+ rewind($output->getStream());
+
+ $this->assertEquals(
+ $this->generateOutput(' - Starting...').
+ $this->generateOutput(' \\ Starting...').
+ $this->generateOutput(' | Starting...').
+ $this->generateOutput(' / Starting...').
+ $this->generateOutput(' - Starting...').
+ $this->generateOutput(' \\ Starting...').
+ $this->generateOutput(' \\ Advancing...').
+ $this->generateOutput(' | Advancing...').
+ $this->generateOutput(' | Done... ').
+ PHP_EOL.
+ $this->generateOutput(' - Starting Again...').
+ $this->generateOutput(' \\ Starting Again...').
+ $this->generateOutput(' \\ Done Again... ').
+ PHP_EOL,
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testNonDecoratedOutput()
+ {
+ $bar = new ProgressIndicator($output = $this->getOutputStream(false));
+
+ $bar->start('Starting...');
+ $bar->advance();
+ $bar->advance();
+ $bar->setMessage('Midway...');
+ $bar->advance();
+ $bar->advance();
+ $bar->finish('Done...');
+
+ rewind($output->getStream());
+
+ $this->assertEquals(
+ ' Starting...'.PHP_EOL.
+ ' Midway... '.PHP_EOL.
+ ' Done... '.PHP_EOL.PHP_EOL,
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ public function testCustomIndicatorValues()
+ {
+ $bar = new ProgressIndicator($output = $this->getOutputStream(), null, 100, array('a', 'b', 'c'));
+
+ $bar->start('Starting...');
+ usleep(101000);
+ $bar->advance();
+ usleep(101000);
+ $bar->advance();
+ usleep(101000);
+ $bar->advance();
+
+ rewind($output->getStream());
+
+ $this->assertEquals(
+ $this->generateOutput(' a Starting...').
+ $this->generateOutput(' b Starting...').
+ $this->generateOutput(' c Starting...').
+ $this->generateOutput(' a Starting...'),
+ stream_get_contents($output->getStream())
+ );
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage Must have at least 2 indicator value characters.
+ */
+ public function testCannotSetInvalidIndicatorCharacters()
+ {
+ $bar = new ProgressIndicator($this->getOutputStream(), null, 100, array('1'));
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage Progress indicator already started.
+ */
+ public function testCannotStartAlreadyStartedIndicator()
+ {
+ $bar = new ProgressIndicator($this->getOutputStream());
+ $bar->start('Starting...');
+ $bar->start('Starting Again.');
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage Progress indicator has not yet been started.
+ */
+ public function testCannotAdvanceUnstartedIndicator()
+ {
+ $bar = new ProgressIndicator($this->getOutputStream());
+ $bar->advance();
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage Progress indicator has not yet been started.
+ */
+ public function testCannotFinishUnstartedIndicator()
+ {
+ $bar = new ProgressIndicator($this->getOutputStream());
+ $bar->finish('Finished');
+ }
+
+ /**
+ * @dataProvider provideFormat
+ */
+ public function testFormats($format)
+ {
+ $bar = new ProgressIndicator($output = $this->getOutputStream(), $format);
+ $bar->start('Starting...');
+ $bar->advance();
+
+ rewind($output->getStream());
+
+ $this->assertNotEmpty(stream_get_contents($output->getStream()));
+ }
+
+ /**
+ * Provides each defined format.
+ *
+ * @return array
+ */
+ public function provideFormat()
+ {
+ return array(
+ array('normal'),
+ array('verbose'),
+ array('very_verbose'),
+ array('debug'),
+ );
+ }
+
+ protected function getOutputStream($decorated = true, $verbosity = StreamOutput::VERBOSITY_NORMAL)
+ {
+ return new StreamOutput(fopen('php://memory', 'r+', false), $verbosity, $decorated);
+ }
+
+ protected function generateOutput($expected)
+ {
+ $count = substr_count($expected, "\n");
+
+ return "\x0D".($count ? sprintf("\033[%dA", $count) : '').$expected;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php b/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php
new file mode 100644
index 00000000..6a4f8ace
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/QuestionHelperTest.php
@@ -0,0 +1,435 @@
+<?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\Formatter\OutputFormatter;
+use Symfony\Component\Console\Helper\QuestionHelper;
+use Symfony\Component\Console\Helper\HelperSet;
+use Symfony\Component\Console\Helper\FormatterHelper;
+use Symfony\Component\Console\Output\StreamOutput;
+use Symfony\Component\Console\Question\ChoiceQuestion;
+use Symfony\Component\Console\Question\ConfirmationQuestion;
+use Symfony\Component\Console\Question\Question;
+
+/**
+ * @group tty
+ */
+class QuestionHelperTest extends \PHPUnit_Framework_TestCase
+{
+ public function testAskChoice()
+ {
+ $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));
+ }
+
+ public function testAsk()
+ {
+ $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()));
+ }
+
+ 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 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));
+ }
+
+ public function testAskWithAutocompleteWithNonSequentialKeys()
+ {
+ 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));
+ }
+
+ public function testAskHiddenResponse()
+ {
+ 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));
+ }
+
+ /**
+ * @dataProvider getAskConfirmationData
+ */
+ public function testAskConfirmation($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'));
+ }
+
+ public function getAskConfirmationData()
+ {
+ return array(
+ array('', true),
+ array('', false, false),
+ array('y', true),
+ array('yes', true),
+ array('n', false),
+ array('no', false),
+ );
+ }
+
+ public function testAskConfirmationWithCustomTrueAnswer()
+ {
+ $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));
+ }
+
+ public function testAskAndValidate()
+ {
+ $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());
+ }
+ }
+
+ /**
+ * @dataProvider simpleAnswerProvider
+ */
+ public function testSelectChoiceFromSimpleChoices($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);
+ }
+
+ public function simpleAnswerProvider()
+ {
+ return array(
+ array(0, 'My environment 1'),
+ array(1, 'My environment 2'),
+ array(2, 'My environment 3'),
+ array('My environment 1', 'My environment 1'),
+ array('My environment 2', 'My environment 2'),
+ array('My environment 3', 'My environment 3'),
+ );
+ }
+
+ /**
+ * @dataProvider mixedKeysChoiceListAnswerProvider
+ */
+ public function testChoiceFromChoicelistWithMixedKeys($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);
+ }
+
+ public function mixedKeysChoiceListAnswerProvider()
+ {
+ return array(
+ array('0', '0'),
+ array('No environment', '0'),
+ array('1', '1'),
+ array('env_2', 'env_2'),
+ array(3, '3'),
+ array('My environment 1', '1'),
+ );
+ }
+
+ /**
+ * @dataProvider answerProvider
+ */
+ public function testSelectChoiceFromChoiceList($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);
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The provided answer is ambiguous. Value should be one of env_2 or env_3.
+ */
+ public function testAmbiguousChoiceFromChoicelist()
+ {
+ $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);
+ }
+
+ public function answerProvider()
+ {
+ return array(
+ array('env_1', 'env_1'),
+ array('env_2', 'env_2'),
+ array('env_3', 'env_3'),
+ array('My environment 1', 'env_1'),
+ );
+ }
+
+ public function testNoInteraction()
+ {
+ $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));
+ }
+
+ /**
+ * @requires function mb_strwidth
+ */
+ public function testChoiceOutputFormattingQuestionForUtf8Keys()
+ {
+ $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->getMock('\Symfony\Component\Console\Output\OutputInterface');
+ $output->method('getFormatter')->willReturn(new OutputFormatter());
+
+ $dialog = new QuestionHelper();
+ $dialog->setInputStream($this->getInputStream("\n"));
+ $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->createInputInterfaceMock(), $output, $question);
+ }
+
+ protected function getInputStream($input)
+ {
+ $stream = fopen('php://memory', 'r+', false);
+ fwrite($stream, $input);
+ rewind($stream);
+
+ return $stream;
+ }
+
+ protected function createOutputInterface()
+ {
+ return new StreamOutput(fopen('php://memory', 'r+', false));
+ }
+
+ protected function createInputInterfaceMock($interactive = true)
+ {
+ $mock = $this->getMock('Symfony\Component\Console\Input\InputInterface');
+ $mock->expects($this->any())
+ ->method('isInteractive')
+ ->will($this->returnValue($interactive));
+
+ return $mock;
+ }
+
+ private function hasSttyAvailable()
+ {
+ exec('stty 2>&1', $output, $exitcode);
+
+ return $exitcode === 0;
+ }
+}
diff --git a/vendor/symfony/console/Tests/Helper/TableStyleTest.php b/vendor/symfony/console/Tests/Helper/TableStyleTest.php
new file mode 100644
index 00000000..587d8414
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/TableStyleTest.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\Helper;
+
+use Symfony\Component\Console\Helper\TableStyle;
+
+class TableStyleTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).
+ */
+ public function testSetPadTypeWithInvalidType()
+ {
+ $style = new TableStyle();
+ $style->setPadType('TEST');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Helper/TableTest.php b/vendor/symfony/console/Tests/Helper/TableTest.php
new file mode 100644
index 00000000..9ecb381a
--- /dev/null
+++ b/vendor/symfony/console/Tests/Helper/TableTest.php
@@ -0,0 +1,645 @@
+<?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\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
+{
+ 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, $style, $expected)
+ {
+ $table = new Table($output = $this->getOutputStream());
+ $table
+ ->setHeaders($headers)
+ ->setRows($rows)
+ ->setStyle($style)
+ ;
+ $table->render();
+
+ $this->assertEquals($expected, $this->getOutputContent($output));
+ }
+
+ /**
+ * @dataProvider testRenderProvider
+ */
+ public function testRenderAddRows($headers, $rows, $style, $expected)
+ {
+ $table = new Table($output = $this->getOutputStream());
+ $table
+ ->setHeaders($headers)
+ ->addRows($rows)
+ ->setStyle($style)
+ ;
+ $table->render();
+
+ $this->assertEquals($expected, $this->getOutputContent($output));
+ }
+
+ /**
+ * @dataProvider testRenderProvider
+ */
+ public function testRenderAddRowsOneByOne($headers, $rows, $style, $expected)
+ {
+ $table = new Table($output = $this->getOutputStream());
+ $table
+ ->setHeaders($headers)
+ ->setStyle($style)
+ ;
+ foreach ($rows as $row) {
+ $table->addRow($row);
+ }
+ $table->render();
+
+ $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,
+ '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,
+ '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,
+ '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'),
+ ),
+ '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'),
+ ),
+ '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"),
+ ),
+ '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(),
+ 'default',
+<<<TABLE
++------+-------+
+| ISBN | Title |
++------+-------+
+
+TABLE
+ ),
+ array(
+ array(),
+ array(),
+ '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</>'),
+ ),
+ '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'),
+ ),
+ '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
+ ),
+ 'Cell with colspan' => array(
+ array('ISBN', 'Title', 'Author'),
+ array(
+ array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
+ new TableSeparator(),
+ array(new TableCell('Divine Comedy(Dante Alighieri)', array('colspan' => 3))),
+ new TableSeparator(),
+ array(
+ new TableCell('Arduino: A Quick-Start Guide', array('colspan' => 2)),
+ 'Mark Schmidt',
+ ),
+ new TableSeparator(),
+ array(
+ '9971-5-0210-0',
+ new TableCell("A Tale of \nTwo Cities", array('colspan' => 2)),
+ ),
+ new TableSeparator(),
+ array(
+ new TableCell('Cupiditate dicta atque porro, tempora exercitationem modi animi nulla nemo vel nihil!', array('colspan' => 3)),
+ ),
+ ),
+ 'default',
+<<<TABLE
++-------------------------------+-------------------------------+-----------------------------+
+| ISBN | Title | Author |
++-------------------------------+-------------------------------+-----------------------------+
+| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
++-------------------------------+-------------------------------+-----------------------------+
+| Divine Comedy(Dante Alighieri) |
++-------------------------------+-------------------------------+-----------------------------+
+| Arduino: A Quick-Start Guide | Mark Schmidt |
++-------------------------------+-------------------------------+-----------------------------+
+| 9971-5-0210-0 | A Tale of |
+| | Two Cities |
++-------------------------------+-------------------------------+-----------------------------+
+| Cupiditate dicta atque porro, tempora exercitationem modi animi nulla nemo vel nihil! |
++-------------------------------+-------------------------------+-----------------------------+
+
+TABLE
+ ),
+ 'Cell with rowspan' => array(
+ array('ISBN', 'Title', 'Author'),
+ array(
+ array(
+ new TableCell('9971-5-0210-0', array('rowspan' => 3)),
+ 'Divine Comedy',
+ 'Dante Alighieri',
+ ),
+ array('A Tale of Two Cities', 'Charles Dickens'),
+ 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
+ ),
+ 'Cell with rowspan and colspan' => array(
+ array('ISBN', 'Title', 'Author'),
+ array(
+ array(
+ new TableCell('9971-5-0210-0', array('rowspan' => 2, 'colspan' => 2)),
+ 'Dante Alighieri',
+ ),
+ array('Charles Dickens'),
+ new TableSeparator(),
+ array(
+ 'Dante Alighieri',
+ new TableCell('9971-5-0210-0', array('rowspan' => 3, 'colspan' => 2)),
+ ),
+ array('J. R. R. Tolkien'),
+ array('J. R. R'),
+ ),
+ 'default',
+<<<TABLE
++------------------+---------+-----------------+
+| ISBN | Title | Author |
++------------------+---------+-----------------+
+| 9971-5-0210-0 | Dante Alighieri |
+| | Charles Dickens |
++------------------+---------+-----------------+
+| Dante Alighieri | 9971-5-0210-0 |
+| J. R. R. Tolkien | |
+| J. R. R | |
++------------------+---------+-----------------+
+
+TABLE
+ ),
+ 'Cell with rowspan and colspan contains new line break' => array(
+ array('ISBN', 'Title', 'Author'),
+ array(
+ array(
+ new TableCell("9971\n-5-\n021\n0-0", array('rowspan' => 2, 'colspan' => 2)),
+ 'Dante Alighieri',
+ ),
+ array('Charles Dickens'),
+ new TableSeparator(),
+ array(
+ 'Dante Alighieri',
+ new TableCell("9971\n-5-\n021\n0-0", array('rowspan' => 2, 'colspan' => 2)),
+ ),
+ array('Charles Dickens'),
+ new TableSeparator(),
+ array(
+ new TableCell("9971\n-5-\n021\n0-0", array('rowspan' => 2, 'colspan' => 2)),
+ new TableCell("Dante \nAlighieri", array('rowspan' => 2, 'colspan' => 1)),
+ ),
+ ),
+ 'default',
+<<<TABLE
++-----------------+-------+-----------------+
+| ISBN | Title | Author |
++-----------------+-------+-----------------+
+| 9971 | Dante Alighieri |
+| -5- | Charles Dickens |
+| 021 | |
+| 0-0 | |
++-----------------+-------+-----------------+
+| Dante Alighieri | 9971 |
+| Charles Dickens | -5- |
+| | 021 |
+| | 0-0 |
++-----------------+-------+-----------------+
+| 9971 | Dante |
+| -5- | Alighieri |
+| 021 | |
+| 0-0 | |
++-----------------+-------+-----------------+
+
+TABLE
+ ),
+ 'Cell with rowspan and colspan without using TableSeparator' => array(
+ array('ISBN', 'Title', 'Author'),
+ array(
+ array(
+ new TableCell("9971\n-5-\n021\n0-0", array('rowspan' => 2, 'colspan' => 2)),
+ 'Dante Alighieri',
+ ),
+ array('Charles Dickens'),
+ array(
+ 'Dante Alighieri',
+ new TableCell("9971\n-5-\n021\n0-0", array('rowspan' => 2, 'colspan' => 2)),
+ ),
+ array('Charles Dickens'),
+ ),
+ 'default',
+<<<TABLE
++-----------------+-------+-----------------+
+| ISBN | Title | Author |
++-----------------+-------+-----------------+
+| 9971 | Dante Alighieri |
+| -5- | Charles Dickens |
+| 021 | |
+| 0-0 | |
+| Dante Alighieri | 9971 |
+| Charles Dickens | -5- |
+| | 021 |
+| | 0-0 |
++-----------------+-------+-----------------+
+
+TABLE
+ ),
+ 'Cell with rowspan and colspan with separator inside a rowspan' => array(
+ array('ISBN', 'Author'),
+ array(
+ array(
+ new TableCell('9971-5-0210-0', array('rowspan' => 3, 'colspan' => 1)),
+ 'Dante Alighieri',
+ ),
+ array(new TableSeparator()),
+ array('Charles Dickens'),
+ ),
+ 'default',
+<<<TABLE
++---------------+-----------------+
+| ISBN | Author |
++---------------+-----------------+
+| 9971-5-0210-0 | Dante Alighieri |
+| |-----------------|
+| | Charles Dickens |
++---------------+-----------------+
+
+TABLE
+ ),
+ 'Multiple header lines' => array(
+ array(
+ array(new TableCell('Main title', array('colspan' => 3))),
+ array('ISBN', 'Title', 'Author'),
+ ),
+ array(),
+ 'default',
+<<<TABLE
++------+-------+--------+
+| Main title |
++------+-------+--------+
+| ISBN | Title | Author |
++------+-------+--------+
+
+TABLE
+ ),
+ 'Row with multiple cells' => array(
+ array(),
+ array(
+ array(
+ new TableCell('1', array('colspan' => 3)),
+ new TableCell('2', array('colspan' => 2)),
+ new TableCell('3', array('colspan' => 2)),
+ new TableCell('4', array('colspan' => 2)),
+ ),
+ ),
+ 'default',
+<<<TABLE
++---+--+--+---+--+---+--+---+--+
+| 1 | 2 | 3 | 4 |
++---+--+--+---+--+---+--+---+--+
+
+TABLE
+ ),
+ );
+ }
+
+ public function testRenderMultiByte()
+ {
+ $table = new Table($output = $this->getOutputStream());
+ $table
+ ->setHeaders(array('■■'))
+ ->setRows(array(array(1234)))
+ ->setStyle('default')
+ ;
+ $table->render();
+
+ $expected =
+<<<TABLE
++------+
+| ■■ |
++------+
+| 1234 |
++------+
+
+TABLE;
+
+ $this->assertEquals($expected, $this->getOutputContent($output));
+ }
+
+ public function testStyle()
+ {
+ $style = new TableStyle();
+ $style
+ ->setHorizontalBorderChar('.')
+ ->setVerticalBorderChar('.')
+ ->setCrossingChar('.')
+ ;
+
+ Table::setStyleDefinition('dotfull', $style);
+ $table = new Table($output = $this->getOutputStream());
+ $table
+ ->setHeaders(array('Foo'))
+ ->setRows(array(array('Bar')))
+ ->setStyle('dotfull');
+ $table->render();
+
+ $expected =
+<<<TABLE
+.......
+. Foo .
+.......
+. Bar .
+.......
+
+TABLE;
+
+ $this->assertEquals($expected, $this->getOutputContent($output));
+ }
+
+ public function testRowSeparator()
+ {
+ $table = new Table($output = $this->getOutputStream());
+ $table
+ ->setHeaders(array('Foo'))
+ ->setRows(array(
+ array('Bar1'),
+ new TableSeparator(),
+ array('Bar2'),
+ new TableSeparator(),
+ array('Bar3'),
+ ));
+ $table->render();
+
+ $expected =
+<<<TABLE
++------+
+| Foo |
++------+
+| Bar1 |
++------+
+| Bar2 |
++------+
+| Bar3 |
++------+
+
+TABLE;
+
+ $this->assertEquals($expected, $this->getOutputContent($output));
+
+ $this->assertEquals($table, $table->addRow(new TableSeparator()), 'fluent interface on addRow() with a single TableSeparator() works');
+ }
+
+ public function testRenderMultiCalls()
+ {
+ $table = new Table($output = $this->getOutputStream());
+ $table->setRows(array(
+ array(new TableCell('foo', array('colspan' => 2))),
+ ));
+ $table->render();
+ $table->render();
+ $table->render();
+
+ $expected =
+<<<TABLE
++----+---+
+| foo |
++----+---+
++----+---+
+| foo |
++----+---+
++----+---+
+| foo |
++----+---+
+
+TABLE;
+
+ $this->assertEquals($expected, $this->getOutputContent($output));
+ }
+
+ public function testColumnStyle()
+ {
+ $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'),
+ ));
+
+ $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));
+ }
+
+ 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/Input/ArgvInputTest.php b/vendor/symfony/console/Tests/Input/ArgvInputTest.php
new file mode 100644
index 00000000..d2c540e6
--- /dev/null
+++ b/vendor/symfony/console/Tests/Input/ArgvInputTest.php
@@ -0,0 +1,317 @@
+<?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\Input;
+
+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
+{
+ public function testConstructor()
+ {
+ $_SERVER['argv'] = array('cli.php', 'foo');
+ $input = new ArgvInput();
+ $r = new \ReflectionObject($input);
+ $p = $r->getProperty('tokens');
+ $p->setAccessible(true);
+
+ $this->assertEquals(array('foo'), $p->getValue($input), '__construct() automatically get its input from the argv server variable');
+ }
+
+ public function testParseArguments()
+ {
+ $input = new ArgvInput(array('cli.php', 'foo'));
+ $input->bind(new InputDefinition(array(new InputArgument('name'))));
+ $this->assertEquals(array('name' => 'foo'), $input->getArguments(), '->parse() parses required arguments');
+
+ $input->bind(new InputDefinition(array(new InputArgument('name'))));
+ $this->assertEquals(array('name' => 'foo'), $input->getArguments(), '->parse() is stateless');
+ }
+
+ /**
+ * @dataProvider provideOptions
+ */
+ public function testParseOptions($input, $options, $expectedOptions, $message)
+ {
+ $input = new ArgvInput($input);
+ $input->bind(new InputDefinition($options));
+
+ $this->assertEquals($expectedOptions, $input->getOptions(), $message);
+ }
+
+ public function provideOptions()
+ {
+ return array(
+ array(
+ array('cli.php', '--foo'),
+ array(new InputOption('foo')),
+ array('foo' => true),
+ '->parse() parses long options without a value',
+ ),
+ array(
+ array('cli.php', '--foo=bar'),
+ array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
+ array('foo' => 'bar'),
+ '->parse() parses long options with a required value (with a = separator)',
+ ),
+ array(
+ array('cli.php', '--foo', 'bar'),
+ array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
+ array('foo' => 'bar'),
+ '->parse() parses long options with a required value (with a space separator)',
+ ),
+ array(
+ array('cli.php', '-f'),
+ array(new InputOption('foo', 'f')),
+ array('foo' => true),
+ '->parse() parses short options without a value',
+ ),
+ array(
+ array('cli.php', '-fbar'),
+ array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
+ array('foo' => 'bar'),
+ '->parse() parses short options with a required value (with no separator)',
+ ),
+ array(
+ array('cli.php', '-f', 'bar'),
+ array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)),
+ array('foo' => 'bar'),
+ '->parse() parses short options with a required value (with a space separator)',
+ ),
+ array(
+ array('cli.php', '-f', ''),
+ array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)),
+ array('foo' => ''),
+ '->parse() parses short options with an optional empty value',
+ ),
+ array(
+ array('cli.php', '-f', '', 'foo'),
+ array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)),
+ array('foo' => ''),
+ '->parse() parses short options with an optional empty value followed by an argument',
+ ),
+ array(
+ array('cli.php', '-f', '', '-b'),
+ array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')),
+ array('foo' => '', 'bar' => true),
+ '->parse() parses short options with an optional empty value followed by an option',
+ ),
+ array(
+ array('cli.php', '-f', '-b', 'foo'),
+ array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')),
+ array('foo' => null, 'bar' => true),
+ '->parse() parses short options with an optional value which is not present',
+ ),
+ array(
+ array('cli.php', '-fb'),
+ array(new InputOption('foo', 'f'), new InputOption('bar', 'b')),
+ array('foo' => true, 'bar' => true),
+ '->parse() parses short options when they are aggregated as a single one',
+ ),
+ array(
+ array('cli.php', '-fb', 'bar'),
+ array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_REQUIRED)),
+ array('foo' => true, 'bar' => 'bar'),
+ '->parse() parses short options when they are aggregated as a single one and the last one has a required value',
+ ),
+ array(
+ array('cli.php', '-fb', 'bar'),
+ array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
+ array('foo' => true, 'bar' => 'bar'),
+ '->parse() parses short options when they are aggregated as a single one and the last one has an optional value',
+ ),
+ array(
+ array('cli.php', '-fbbar'),
+ array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
+ array('foo' => true, 'bar' => 'bar'),
+ '->parse() parses short options when they are aggregated as a single one and the last one has an optional value with no separator',
+ ),
+ array(
+ array('cli.php', '-fbbar'),
+ array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)),
+ array('foo' => 'bbar', 'bar' => null),
+ '->parse() parses short options when they are aggregated as a single one and one of them takes a value',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider provideInvalidInput
+ */
+ public function testInvalidInput($argv, $definition, $expectedExceptionMessage)
+ {
+ $this->setExpectedException('RuntimeException', $expectedExceptionMessage);
+
+ $input = new ArgvInput($argv);
+ $input->bind($definition);
+ }
+
+ public function provideInvalidInput()
+ {
+ return array(
+ array(
+ array('cli.php', '--foo'),
+ new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))),
+ 'The "--foo" option requires a value.',
+ ),
+ array(
+ array('cli.php', '-f'),
+ new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))),
+ 'The "--foo" option requires a value.',
+ ),
+ array(
+ array('cli.php', '-ffoo'),
+ new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE))),
+ 'The "-o" option does not exist.',
+ ),
+ array(
+ array('cli.php', '--foo=bar'),
+ new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE))),
+ 'The "--foo" option does not accept a value.',
+ ),
+ array(
+ array('cli.php', 'foo', 'bar'),
+ new InputDefinition(),
+ 'Too many arguments.',
+ ),
+ array(
+ array('cli.php', '--foo'),
+ new InputDefinition(),
+ 'The "--foo" option does not exist.',
+ ),
+ array(
+ array('cli.php', '-f'),
+ new InputDefinition(),
+ 'The "-f" option does not exist.',
+ ),
+ array(
+ array('cli.php', '-1'),
+ new InputDefinition(array(new InputArgument('number'))),
+ 'The "-1" option does not exist.',
+ ),
+ );
+ }
+
+ public function testParseArrayArgument()
+ {
+ $input = new ArgvInput(array('cli.php', 'foo', 'bar', 'baz', 'bat'));
+ $input->bind(new InputDefinition(array(new InputArgument('name', InputArgument::IS_ARRAY))));
+
+ $this->assertEquals(array('name' => array('foo', 'bar', 'baz', 'bat')), $input->getArguments(), '->parse() parses array arguments');
+ }
+
+ public function testParseArrayOption()
+ {
+ $input = new ArgvInput(array('cli.php', '--name=foo', '--name=bar', '--name=baz'));
+ $input->bind(new InputDefinition(array(new InputOption('name', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY))));
+
+ $this->assertEquals(array('name' => array('foo', 'bar', 'baz')), $input->getOptions(), '->parse() parses array options ("--option=value" syntax)');
+
+ $input = new ArgvInput(array('cli.php', '--name', 'foo', '--name', 'bar', '--name', 'baz'));
+ $input->bind(new InputDefinition(array(new InputOption('name', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY))));
+ $this->assertEquals(array('name' => array('foo', 'bar', 'baz')), $input->getOptions(), '->parse() parses array options ("--option value" syntax)');
+
+ $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)');
+
+ $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)');
+ }
+
+ public function testParseNegativeNumberAfterDoubleDash()
+ {
+ $input = new ArgvInput(array('cli.php', '--', '-1'));
+ $input->bind(new InputDefinition(array(new InputArgument('number'))));
+ $this->assertEquals(array('number' => '-1'), $input->getArguments(), '->parse() parses arguments with leading dashes as arguments after having encountered a double-dash sequence');
+
+ $input = new ArgvInput(array('cli.php', '-f', 'bar', '--', '-1'));
+ $input->bind(new InputDefinition(array(new InputArgument('number'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL))));
+ $this->assertEquals(array('foo' => 'bar'), $input->getOptions(), '->parse() parses arguments with leading dashes as options before having encountered a double-dash sequence');
+ $this->assertEquals(array('number' => '-1'), $input->getArguments(), '->parse() parses arguments with leading dashes as arguments after having encountered a double-dash sequence');
+ }
+
+ public function testParseEmptyStringArgument()
+ {
+ $input = new ArgvInput(array('cli.php', '-f', 'bar', ''));
+ $input->bind(new InputDefinition(array(new InputArgument('empty'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL))));
+
+ $this->assertEquals(array('empty' => ''), $input->getArguments(), '->parse() parses empty string arguments');
+ }
+
+ public function testGetFirstArgument()
+ {
+ $input = new ArgvInput(array('cli.php', '-fbbar'));
+ $this->assertNull($input->getFirstArgument(), '->getFirstArgument() returns null when there is no arguments');
+
+ $input = new ArgvInput(array('cli.php', '-fbbar', 'foo'));
+ $this->assertEquals('foo', $input->getFirstArgument(), '->getFirstArgument() returns the first argument from the raw input');
+ }
+
+ public function testHasParameterOption()
+ {
+ $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', '--foo', 'foo'));
+ $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given short option is in the raw input');
+
+ $input = new ArgvInput(array('cli.php', 'foo'));
+ $this->assertFalse($input->hasParameterOption('--foo'), '->hasParameterOption() returns false if the given short option is not in the raw input');
+
+ $input = new ArgvInput(array('cli.php', '--foo=bar'));
+ $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if the given option with provided value is in the raw input');
+ }
+
+ public function testToString()
+ {
+ $input = new ArgvInput(array('cli.php', '-f', 'foo'));
+ $this->assertEquals('-f foo', (string) $input);
+
+ $input = new ArgvInput(array('cli.php', '-f', '--bar=foo', 'a b c d', "A\nB'C"));
+ $this->assertEquals('-f --bar=foo '.escapeshellarg('a b c d').' '.escapeshellarg("A\nB'C"), (string) $input);
+ }
+
+ /**
+ * @dataProvider provideGetParameterOptionValues
+ */
+ public function testGetParameterOptionEqualSign($argv, $key, $expected)
+ {
+ $input = new ArgvInput($argv);
+ $this->assertEquals($expected, $input->getParameterOption($key), '->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'),
+ );
+ }
+
+ public function testParseSingleDashAsArgument()
+ {
+ $input = new ArgvInput(array('cli.php', '-'));
+ $input->bind(new InputDefinition(array(new InputArgument('file'))));
+ $this->assertEquals(array('file' => '-'), $input->getArguments(), '->parse() parses single dash as an argument');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Input/ArrayInputTest.php b/vendor/symfony/console/Tests/Input/ArrayInputTest.php
new file mode 100644
index 00000000..cc89083c
--- /dev/null
+++ b/vendor/symfony/console/Tests/Input/ArrayInputTest.php
@@ -0,0 +1,138 @@
+<?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\Input;
+
+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
+{
+ public function testGetFirstArgument()
+ {
+ $input = new ArrayInput(array());
+ $this->assertNull($input->getFirstArgument(), '->getFirstArgument() returns null if no argument were passed');
+ $input = new ArrayInput(array('name' => 'Fabien'));
+ $this->assertEquals('Fabien', $input->getFirstArgument(), '->getFirstArgument() returns the first passed argument');
+ $input = new ArrayInput(array('--foo' => 'bar', 'name' => 'Fabien'));
+ $this->assertEquals('Fabien', $input->getFirstArgument(), '->getFirstArgument() returns the first passed argument');
+ }
+
+ public function testHasParameterOption()
+ {
+ $input = new ArrayInput(array('name' => 'Fabien', '--foo' => 'bar'));
+ $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters');
+ $this->assertFalse($input->hasParameterOption('--bar'), '->hasParameterOption() returns false if an option is not present in the passed parameters');
+
+ $input = new ArrayInput(array('--foo'));
+ $this->assertTrue($input->hasParameterOption('--foo'), '->hasParameterOption() returns true if an option is present in the passed parameters');
+ }
+
+ public function testGetParameterOption()
+ {
+ $input = new ArrayInput(array('name' => 'Fabien', '--foo' => 'bar'));
+ $this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name');
+
+ $input = new ArrayInput(array('Fabien', '--foo' => 'bar'));
+ $this->assertEquals('bar', $input->getParameterOption('--foo'), '->getParameterOption() returns the option of specified name');
+ }
+
+ public function testParseArguments()
+ {
+ $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name'))));
+
+ $this->assertEquals(array('name' => 'foo'), $input->getArguments(), '->parse() parses required arguments');
+ }
+
+ /**
+ * @dataProvider provideOptions
+ */
+ public function testParseOptions($input, $options, $expectedOptions, $message)
+ {
+ $input = new ArrayInput($input, new InputDefinition($options));
+
+ $this->assertEquals($expectedOptions, $input->getOptions(), $message);
+ }
+
+ public function provideOptions()
+ {
+ return array(
+ array(
+ array('--foo' => 'bar'),
+ array(new InputOption('foo')),
+ array('foo' => 'bar'),
+ '->parse() parses long options',
+ ),
+ array(
+ array('--foo' => 'bar'),
+ array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')),
+ array('foo' => 'bar'),
+ '->parse() parses long options with a default value',
+ ),
+ array(
+ array('--foo' => null),
+ array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')),
+ array('foo' => 'default'),
+ '->parse() parses long options with a default value',
+ ),
+ array(
+ array('-f' => 'bar'),
+ array(new InputOption('foo', 'f')),
+ array('foo' => 'bar'),
+ '->parse() parses short options',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider provideInvalidInput
+ */
+ public function testParseInvalidInput($parameters, $definition, $expectedExceptionMessage)
+ {
+ $this->setExpectedException('InvalidArgumentException', $expectedExceptionMessage);
+
+ new ArrayInput($parameters, $definition);
+ }
+
+ public function provideInvalidInput()
+ {
+ return array(
+ array(
+ array('foo' => 'foo'),
+ new InputDefinition(array(new InputArgument('name'))),
+ 'The "foo" argument does not exist.',
+ ),
+ array(
+ array('--foo' => null),
+ new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))),
+ 'The "--foo" option requires a value.',
+ ),
+ array(
+ array('--foo' => 'foo'),
+ new InputDefinition(),
+ 'The "--foo" option does not exist.',
+ ),
+ array(
+ array('-o' => 'foo'),
+ new InputDefinition(),
+ 'The "-o" option does not exist.',
+ ),
+ );
+ }
+
+ public function testToString()
+ {
+ $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);
+ }
+}
diff --git a/vendor/symfony/console/Tests/Input/InputArgumentTest.php b/vendor/symfony/console/Tests/Input/InputArgumentTest.php
new file mode 100644
index 00000000..cfb37cd4
--- /dev/null
+++ b/vendor/symfony/console/Tests/Input/InputArgumentTest.php
@@ -0,0 +1,111 @@
+<?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\Input;
+
+use Symfony\Component\Console\Input\InputArgument;
+
+class InputArgumentTest extends \PHPUnit_Framework_TestCase
+{
+ public function testConstructor()
+ {
+ $argument = new InputArgument('foo');
+ $this->assertEquals('foo', $argument->getName(), '__construct() takes a name as its first argument');
+ }
+
+ public function testModes()
+ {
+ $argument = new InputArgument('foo');
+ $this->assertFalse($argument->isRequired(), '__construct() gives a "InputArgument::OPTIONAL" mode by default');
+
+ $argument = new InputArgument('foo', null);
+ $this->assertFalse($argument->isRequired(), '__construct() can take "InputArgument::OPTIONAL" as its mode');
+
+ $argument = new InputArgument('foo', InputArgument::OPTIONAL);
+ $this->assertFalse($argument->isRequired(), '__construct() can take "InputArgument::OPTIONAL" as its mode');
+
+ $argument = new InputArgument('foo', InputArgument::REQUIRED);
+ $this->assertTrue($argument->isRequired(), '__construct() can take "InputArgument::REQUIRED" as its mode');
+ }
+
+ /**
+ * @dataProvider provideInvalidModes
+ */
+ public function testInvalidModes($mode)
+ {
+ $this->setExpectedException('InvalidArgumentException', sprintf('Argument mode "%s" is not valid.', $mode));
+
+ new InputArgument('foo', $mode);
+ }
+
+ public function provideInvalidModes()
+ {
+ return array(
+ array('ANOTHER_ONE'),
+ array(-1),
+ );
+ }
+
+ public function testIsArray()
+ {
+ $argument = new InputArgument('foo', InputArgument::IS_ARRAY);
+ $this->assertTrue($argument->isArray(), '->isArray() returns true if the argument can be an array');
+ $argument = new InputArgument('foo', InputArgument::OPTIONAL | InputArgument::IS_ARRAY);
+ $this->assertTrue($argument->isArray(), '->isArray() returns true if the argument can be an array');
+ $argument = new InputArgument('foo', InputArgument::OPTIONAL);
+ $this->assertFalse($argument->isArray(), '->isArray() returns false if the argument can not be an array');
+ }
+
+ public function testGetDescription()
+ {
+ $argument = new InputArgument('foo', null, 'Some description');
+ $this->assertEquals('Some description', $argument->getDescription(), '->getDescription() return the message description');
+ }
+
+ public function testGetDefault()
+ {
+ $argument = new InputArgument('foo', InputArgument::OPTIONAL, '', 'default');
+ $this->assertEquals('default', $argument->getDefault(), '->getDefault() return the default value');
+ }
+
+ public function testSetDefault()
+ {
+ $argument = new InputArgument('foo', InputArgument::OPTIONAL, '', 'default');
+ $argument->setDefault(null);
+ $this->assertNull($argument->getDefault(), '->setDefault() can reset the default value by passing null');
+ $argument->setDefault('another');
+ $this->assertEquals('another', $argument->getDefault(), '->setDefault() changes the default value');
+
+ $argument = new InputArgument('foo', InputArgument::OPTIONAL | InputArgument::IS_ARRAY);
+ $argument->setDefault(array(1, 2));
+ $this->assertEquals(array(1, 2), $argument->getDefault(), '->setDefault() changes the default value');
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage Cannot set a default value except for InputArgument::OPTIONAL mode.
+ */
+ public function testSetDefaultWithRequiredArgument()
+ {
+ $argument = new InputArgument('foo', InputArgument::REQUIRED);
+ $argument->setDefault('default');
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage A default value for an array argument must be an array.
+ */
+ public function testSetDefaultWithArrayArgument()
+ {
+ $argument = new InputArgument('foo', InputArgument::IS_ARRAY);
+ $argument->setDefault('default');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Input/InputDefinitionTest.php b/vendor/symfony/console/Tests/Input/InputDefinitionTest.php
new file mode 100644
index 00000000..7e0a2425
--- /dev/null
+++ b/vendor/symfony/console/Tests/Input/InputDefinitionTest.php
@@ -0,0 +1,437 @@
+<?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\Input;
+
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+
+class InputDefinitionTest extends \PHPUnit_Framework_TestCase
+{
+ protected static $fixtures;
+
+ protected $foo, $bar, $foo1, $foo2;
+
+ public static function setUpBeforeClass()
+ {
+ self::$fixtures = __DIR__.'/../Fixtures/';
+ }
+
+ public function testConstructorArguments()
+ {
+ $this->initializeArguments();
+
+ $definition = new InputDefinition();
+ $this->assertEquals(array(), $definition->getArguments(), '__construct() creates a new InputDefinition object');
+
+ $definition = new InputDefinition(array($this->foo, $this->bar));
+ $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getArguments(), '__construct() takes an array of InputArgument objects as its first argument');
+ }
+
+ public function testConstructorOptions()
+ {
+ $this->initializeOptions();
+
+ $definition = new InputDefinition();
+ $this->assertEquals(array(), $definition->getOptions(), '__construct() creates a new InputDefinition object');
+
+ $definition = new InputDefinition(array($this->foo, $this->bar));
+ $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getOptions(), '__construct() takes an array of InputOption objects as its first argument');
+ }
+
+ public function testSetArguments()
+ {
+ $this->initializeArguments();
+
+ $definition = new InputDefinition();
+ $definition->setArguments(array($this->foo));
+ $this->assertEquals(array('foo' => $this->foo), $definition->getArguments(), '->setArguments() sets the array of InputArgument objects');
+ $definition->setArguments(array($this->bar));
+
+ $this->assertEquals(array('bar' => $this->bar), $definition->getArguments(), '->setArguments() clears all InputArgument objects');
+ }
+
+ public function testAddArguments()
+ {
+ $this->initializeArguments();
+
+ $definition = new InputDefinition();
+ $definition->addArguments(array($this->foo));
+ $this->assertEquals(array('foo' => $this->foo), $definition->getArguments(), '->addArguments() adds an array of InputArgument objects');
+ $definition->addArguments(array($this->bar));
+ $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getArguments(), '->addArguments() does not clear existing InputArgument objects');
+ }
+
+ public function testAddArgument()
+ {
+ $this->initializeArguments();
+
+ $definition = new InputDefinition();
+ $definition->addArgument($this->foo);
+ $this->assertEquals(array('foo' => $this->foo), $definition->getArguments(), '->addArgument() adds a InputArgument object');
+ $definition->addArgument($this->bar);
+ $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getArguments(), '->addArgument() adds a InputArgument object');
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage An argument with name "foo" already exists.
+ */
+ public function testArgumentsMustHaveDifferentNames()
+ {
+ $this->initializeArguments();
+
+ $definition = new InputDefinition();
+ $definition->addArgument($this->foo);
+ $definition->addArgument($this->foo1);
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage Cannot add an argument after an array argument.
+ */
+ public function testArrayArgumentHasToBeLast()
+ {
+ $this->initializeArguments();
+
+ $definition = new InputDefinition();
+ $definition->addArgument(new InputArgument('fooarray', InputArgument::IS_ARRAY));
+ $definition->addArgument(new InputArgument('anotherbar'));
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage Cannot add a required argument after an optional one.
+ */
+ public function testRequiredArgumentCannotFollowAnOptionalOne()
+ {
+ $this->initializeArguments();
+
+ $definition = new InputDefinition();
+ $definition->addArgument($this->foo);
+ $definition->addArgument($this->foo2);
+ }
+
+ public function testGetArgument()
+ {
+ $this->initializeArguments();
+
+ $definition = new InputDefinition();
+ $definition->addArguments(array($this->foo));
+ $this->assertEquals($this->foo, $definition->getArgument('foo'), '->getArgument() returns a InputArgument by its name');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The "bar" argument does not exist.
+ */
+ public function testGetInvalidArgument()
+ {
+ $this->initializeArguments();
+
+ $definition = new InputDefinition();
+ $definition->addArguments(array($this->foo));
+ $definition->getArgument('bar');
+ }
+
+ public function testHasArgument()
+ {
+ $this->initializeArguments();
+
+ $definition = new InputDefinition();
+ $definition->addArguments(array($this->foo));
+
+ $this->assertTrue($definition->hasArgument('foo'), '->hasArgument() returns true if a InputArgument exists for the given name');
+ $this->assertFalse($definition->hasArgument('bar'), '->hasArgument() returns false if a InputArgument exists for the given name');
+ }
+
+ public function testGetArgumentRequiredCount()
+ {
+ $this->initializeArguments();
+
+ $definition = new InputDefinition();
+ $definition->addArgument($this->foo2);
+ $this->assertEquals(1, $definition->getArgumentRequiredCount(), '->getArgumentRequiredCount() returns the number of required arguments');
+ $definition->addArgument($this->foo);
+ $this->assertEquals(1, $definition->getArgumentRequiredCount(), '->getArgumentRequiredCount() returns the number of required arguments');
+ }
+
+ public function testGetArgumentCount()
+ {
+ $this->initializeArguments();
+
+ $definition = new InputDefinition();
+ $definition->addArgument($this->foo2);
+ $this->assertEquals(1, $definition->getArgumentCount(), '->getArgumentCount() returns the number of arguments');
+ $definition->addArgument($this->foo);
+ $this->assertEquals(2, $definition->getArgumentCount(), '->getArgumentCount() returns the number of arguments');
+ }
+
+ public function testGetArgumentDefaults()
+ {
+ $definition = new InputDefinition(array(
+ new InputArgument('foo1', InputArgument::OPTIONAL),
+ new InputArgument('foo2', InputArgument::OPTIONAL, '', 'default'),
+ new InputArgument('foo3', InputArgument::OPTIONAL | InputArgument::IS_ARRAY),
+ // new InputArgument('foo4', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, '', array(1, 2)),
+ ));
+ $this->assertEquals(array('foo1' => null, 'foo2' => 'default', 'foo3' => array()), $definition->getArgumentDefaults(), '->getArgumentDefaults() return the default values for each argument');
+
+ $definition = new InputDefinition(array(
+ new InputArgument('foo4', InputArgument::OPTIONAL | InputArgument::IS_ARRAY, '', array(1, 2)),
+ ));
+ $this->assertEquals(array('foo4' => array(1, 2)), $definition->getArgumentDefaults(), '->getArgumentDefaults() return the default values for each argument');
+ }
+
+ public function testSetOptions()
+ {
+ $this->initializeOptions();
+
+ $definition = new InputDefinition(array($this->foo));
+ $this->assertEquals(array('foo' => $this->foo), $definition->getOptions(), '->setOptions() sets the array of InputOption objects');
+ $definition->setOptions(array($this->bar));
+ $this->assertEquals(array('bar' => $this->bar), $definition->getOptions(), '->setOptions() clears all InputOption objects');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The "-f" option does not exist.
+ */
+ public function testSetOptionsClearsOptions()
+ {
+ $this->initializeOptions();
+
+ $definition = new InputDefinition(array($this->foo));
+ $definition->setOptions(array($this->bar));
+ $definition->getOptionForShortcut('f');
+ }
+
+ public function testAddOptions()
+ {
+ $this->initializeOptions();
+
+ $definition = new InputDefinition(array($this->foo));
+ $this->assertEquals(array('foo' => $this->foo), $definition->getOptions(), '->addOptions() adds an array of InputOption objects');
+ $definition->addOptions(array($this->bar));
+ $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getOptions(), '->addOptions() does not clear existing InputOption objects');
+ }
+
+ public function testAddOption()
+ {
+ $this->initializeOptions();
+
+ $definition = new InputDefinition();
+ $definition->addOption($this->foo);
+ $this->assertEquals(array('foo' => $this->foo), $definition->getOptions(), '->addOption() adds a InputOption object');
+ $definition->addOption($this->bar);
+ $this->assertEquals(array('foo' => $this->foo, 'bar' => $this->bar), $definition->getOptions(), '->addOption() adds a InputOption object');
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage An option named "foo" already exists.
+ */
+ public function testAddDuplicateOption()
+ {
+ $this->initializeOptions();
+
+ $definition = new InputDefinition();
+ $definition->addOption($this->foo);
+ $definition->addOption($this->foo2);
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage An option with shortcut "f" already exists.
+ */
+ public function testAddDuplicateShortcutOption()
+ {
+ $this->initializeOptions();
+
+ $definition = new InputDefinition();
+ $definition->addOption($this->foo);
+ $definition->addOption($this->foo1);
+ }
+
+ public function testGetOption()
+ {
+ $this->initializeOptions();
+
+ $definition = new InputDefinition(array($this->foo));
+ $this->assertEquals($this->foo, $definition->getOption('foo'), '->getOption() returns a InputOption by its name');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The "--bar" option does not exist.
+ */
+ public function testGetInvalidOption()
+ {
+ $this->initializeOptions();
+
+ $definition = new InputDefinition(array($this->foo));
+ $definition->getOption('bar');
+ }
+
+ public function testHasOption()
+ {
+ $this->initializeOptions();
+
+ $definition = new InputDefinition(array($this->foo));
+ $this->assertTrue($definition->hasOption('foo'), '->hasOption() returns true if a InputOption exists for the given name');
+ $this->assertFalse($definition->hasOption('bar'), '->hasOption() returns false if a InputOption exists for the given name');
+ }
+
+ public function testHasShortcut()
+ {
+ $this->initializeOptions();
+
+ $definition = new InputDefinition(array($this->foo));
+ $this->assertTrue($definition->hasShortcut('f'), '->hasShortcut() returns true if a InputOption exists for the given shortcut');
+ $this->assertFalse($definition->hasShortcut('b'), '->hasShortcut() returns false if a InputOption exists for the given shortcut');
+ }
+
+ public function testGetOptionForShortcut()
+ {
+ $this->initializeOptions();
+
+ $definition = new InputDefinition(array($this->foo));
+ $this->assertEquals($this->foo, $definition->getOptionForShortcut('f'), '->getOptionForShortcut() returns a InputOption by its shortcut');
+ }
+
+ public function testGetOptionForMultiShortcut()
+ {
+ $this->initializeOptions();
+
+ $definition = new InputDefinition(array($this->multi));
+ $this->assertEquals($this->multi, $definition->getOptionForShortcut('m'), '->getOptionForShortcut() returns a InputOption by its shortcut');
+ $this->assertEquals($this->multi, $definition->getOptionForShortcut('mmm'), '->getOptionForShortcut() returns a InputOption by its shortcut');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The "-l" option does not exist.
+ */
+ public function testGetOptionForInvalidShortcut()
+ {
+ $this->initializeOptions();
+
+ $definition = new InputDefinition(array($this->foo));
+ $definition->getOptionForShortcut('l');
+ }
+
+ public function testGetOptionDefaults()
+ {
+ $definition = new InputDefinition(array(
+ new InputOption('foo1', null, InputOption::VALUE_NONE),
+ new InputOption('foo2', null, InputOption::VALUE_REQUIRED),
+ new InputOption('foo3', null, InputOption::VALUE_REQUIRED, '', 'default'),
+ new InputOption('foo4', null, InputOption::VALUE_OPTIONAL),
+ new InputOption('foo5', null, InputOption::VALUE_OPTIONAL, '', 'default'),
+ new InputOption('foo6', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY),
+ new InputOption('foo7', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, '', array(1, 2)),
+ ));
+ $defaults = array(
+ 'foo1' => false,
+ 'foo2' => null,
+ 'foo3' => 'default',
+ 'foo4' => null,
+ 'foo5' => 'default',
+ 'foo6' => array(),
+ 'foo7' => array(1, 2),
+ );
+ $this->assertSame($defaults, $definition->getOptionDefaults(), '->getOptionDefaults() returns the default values for all options');
+ }
+
+ /**
+ * @dataProvider getGetSynopsisData
+ */
+ public function testGetSynopsis(InputDefinition $definition, $expectedSynopsis, $message = null)
+ {
+ $this->assertEquals($expectedSynopsis, $definition->getSynopsis(), $message ? '->getSynopsis() '.$message : '');
+ }
+
+ public function getGetSynopsisData()
+ {
+ return array(
+ array(new InputDefinition(array(new InputOption('foo'))), '[--foo]', 'puts optional options in square brackets'),
+ array(new InputDefinition(array(new InputOption('foo', 'f'))), '[-f|--foo]', 'separates shortcut with a pipe'),
+ array(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))), '[-f|--foo FOO]', 'uses shortcut as value placeholder'),
+ array(new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL))), '[-f|--foo [FOO]]', 'puts optional values in square brackets'),
+
+ array(new InputDefinition(array(new InputArgument('foo', InputArgument::REQUIRED))), '<foo>', 'puts arguments in angle brackets'),
+ array(new InputDefinition(array(new InputArgument('foo'))), '[<foo>]', 'puts optional arguments in square brackets'),
+ array(new InputDefinition(array(new InputArgument('foo', InputArgument::IS_ARRAY))), '[<foo>]...', 'uses an ellipsis for array arguments'),
+ array(new InputDefinition(array(new InputArgument('foo', InputArgument::REQUIRED | InputArgument::IS_ARRAY))), '<foo> (<foo>)...', 'uses parenthesis and ellipsis for required array arguments'),
+
+ array(new InputDefinition(array(new InputOption('foo'), new InputArgument('foo', InputArgument::REQUIRED))), '[--foo] [--] <foo>', 'puts [--] between options and arguments'),
+ );
+ }
+
+ public function testGetShortSynopsis()
+ {
+ $definition = new InputDefinition(array(new InputOption('foo'), new InputOption('bar'), new InputArgument('cat')));
+ $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');
+ $this->bar = new InputArgument('bar');
+ $this->foo1 = new InputArgument('foo');
+ $this->foo2 = new InputArgument('foo2', InputArgument::REQUIRED);
+ }
+
+ protected function initializeOptions()
+ {
+ $this->foo = new InputOption('foo', 'f');
+ $this->bar = new InputOption('bar', 'b');
+ $this->foo1 = new InputOption('fooBis', 'f');
+ $this->foo2 = new InputOption('foo', 'p');
+ $this->multi = new InputOption('multi', 'm|mm|mmm');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Input/InputOptionTest.php b/vendor/symfony/console/Tests/Input/InputOptionTest.php
new file mode 100644
index 00000000..53ce1df8
--- /dev/null
+++ b/vendor/symfony/console/Tests/Input/InputOptionTest.php
@@ -0,0 +1,204 @@
+<?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\Input;
+
+use Symfony\Component\Console\Input\InputOption;
+
+class InputOptionTest extends \PHPUnit_Framework_TestCase
+{
+ public function testConstructor()
+ {
+ $option = new InputOption('foo');
+ $this->assertEquals('foo', $option->getName(), '__construct() takes a name as its first argument');
+ $option = new InputOption('--foo');
+ $this->assertEquals('foo', $option->getName(), '__construct() removes the leading -- of the option name');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.
+ */
+ public function testArrayModeWithoutValue()
+ {
+ new InputOption('foo', 'f', InputOption::VALUE_IS_ARRAY);
+ }
+
+ public function testShortcut()
+ {
+ $option = new InputOption('foo', 'f');
+ $this->assertEquals('f', $option->getShortcut(), '__construct() can take a shortcut as its second argument');
+ $option = new InputOption('foo', '-f|-ff|fff');
+ $this->assertEquals('f|ff|fff', $option->getShortcut(), '__construct() removes the leading - of the shortcuts');
+ $option = new InputOption('foo', array('f', 'ff', '-fff'));
+ $this->assertEquals('f|ff|fff', $option->getShortcut(), '__construct() removes the leading - of the shortcuts');
+ $option = new InputOption('foo');
+ $this->assertNull($option->getShortcut(), '__construct() makes the shortcut null by default');
+ }
+
+ public function testModes()
+ {
+ $option = new InputOption('foo', 'f');
+ $this->assertFalse($option->acceptValue(), '__construct() gives a "InputOption::VALUE_NONE" mode by default');
+ $this->assertFalse($option->isValueRequired(), '__construct() gives a "InputOption::VALUE_NONE" mode by default');
+ $this->assertFalse($option->isValueOptional(), '__construct() gives a "InputOption::VALUE_NONE" mode by default');
+
+ $option = new InputOption('foo', 'f', null);
+ $this->assertFalse($option->acceptValue(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
+ $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
+ $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
+
+ $option = new InputOption('foo', 'f', InputOption::VALUE_NONE);
+ $this->assertFalse($option->acceptValue(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
+ $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
+ $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_NONE" as its mode');
+
+ $option = new InputOption('foo', 'f', InputOption::VALUE_REQUIRED);
+ $this->assertTrue($option->acceptValue(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode');
+ $this->assertTrue($option->isValueRequired(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode');
+ $this->assertFalse($option->isValueOptional(), '__construct() can take "InputOption::VALUE_REQUIRED" as its mode');
+
+ $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL);
+ $this->assertTrue($option->acceptValue(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode');
+ $this->assertFalse($option->isValueRequired(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode');
+ $this->assertTrue($option->isValueOptional(), '__construct() can take "InputOption::VALUE_OPTIONAL" as its mode');
+ }
+
+ /**
+ * @dataProvider provideInvalidModes
+ */
+ public function testInvalidModes($mode)
+ {
+ $this->setExpectedException('InvalidArgumentException', sprintf('Option mode "%s" is not valid.', $mode));
+
+ new InputOption('foo', 'f', $mode);
+ }
+
+ public function provideInvalidModes()
+ {
+ return array(
+ array('ANOTHER_ONE'),
+ array(-1),
+ );
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testEmptyNameIsInvalid()
+ {
+ new InputOption('');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testDoubleDashNameIsInvalid()
+ {
+ new InputOption('--');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testSingleDashOptionIsInvalid()
+ {
+ new InputOption('foo', '-');
+ }
+
+ public function testIsArray()
+ {
+ $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY);
+ $this->assertTrue($option->isArray(), '->isArray() returns true if the option can be an array');
+ $option = new InputOption('foo', null, InputOption::VALUE_NONE);
+ $this->assertFalse($option->isArray(), '->isArray() returns false if the option can not be an array');
+ }
+
+ public function testGetDescription()
+ {
+ $option = new InputOption('foo', 'f', null, 'Some description');
+ $this->assertEquals('Some description', $option->getDescription(), '->getDescription() returns the description message');
+ }
+
+ public function testGetDefault()
+ {
+ $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL, '', 'default');
+ $this->assertEquals('default', $option->getDefault(), '->getDefault() returns the default value');
+
+ $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED, '', 'default');
+ $this->assertEquals('default', $option->getDefault(), '->getDefault() returns the default value');
+
+ $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED);
+ $this->assertNull($option->getDefault(), '->getDefault() returns null if no default value is configured');
+
+ $option = new InputOption('foo', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY);
+ $this->assertEquals(array(), $option->getDefault(), '->getDefault() returns an empty array if option is an array');
+
+ $option = new InputOption('foo', null, InputOption::VALUE_NONE);
+ $this->assertFalse($option->getDefault(), '->getDefault() returns false if the option does not take a value');
+ }
+
+ public function testSetDefault()
+ {
+ $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED, '', 'default');
+ $option->setDefault(null);
+ $this->assertNull($option->getDefault(), '->setDefault() can reset the default value by passing null');
+ $option->setDefault('another');
+ $this->assertEquals('another', $option->getDefault(), '->setDefault() changes the default value');
+
+ $option = new InputOption('foo', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY);
+ $option->setDefault(array(1, 2));
+ $this->assertEquals(array(1, 2), $option->getDefault(), '->setDefault() changes the default value');
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage Cannot set a default value when using InputOption::VALUE_NONE mode.
+ */
+ public function testDefaultValueWithValueNoneMode()
+ {
+ $option = new InputOption('foo', 'f', InputOption::VALUE_NONE);
+ $option->setDefault('default');
+ }
+
+ /**
+ * @expectedException \LogicException
+ * @expectedExceptionMessage A default value for an array option must be an array.
+ */
+ public function testDefaultValueWithIsArrayMode()
+ {
+ $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY);
+ $option->setDefault('default');
+ }
+
+ public function testEquals()
+ {
+ $option = new InputOption('foo', 'f', null, 'Some description');
+ $option2 = new InputOption('foo', 'f', null, 'Alternative description');
+ $this->assertTrue($option->equals($option2));
+
+ $option = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description');
+ $option2 = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description', true);
+ $this->assertFalse($option->equals($option2));
+
+ $option = new InputOption('foo', 'f', null, 'Some description');
+ $option2 = new InputOption('bar', 'f', null, 'Some description');
+ $this->assertFalse($option->equals($option2));
+
+ $option = new InputOption('foo', 'f', null, 'Some description');
+ $option2 = new InputOption('foo', '', null, 'Some description');
+ $this->assertFalse($option->equals($option2));
+
+ $option = new InputOption('foo', 'f', null, 'Some description');
+ $option2 = new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, 'Some description');
+ $this->assertFalse($option->equals($option2));
+ }
+}
diff --git a/vendor/symfony/console/Tests/Input/InputTest.php b/vendor/symfony/console/Tests/Input/InputTest.php
new file mode 100644
index 00000000..eb1c6617
--- /dev/null
+++ b/vendor/symfony/console/Tests/Input/InputTest.php
@@ -0,0 +1,132 @@
+<?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\Input;
+
+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
+{
+ public function testConstructor()
+ {
+ $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name'))));
+ $this->assertEquals('foo', $input->getArgument('name'), '->__construct() takes a InputDefinition as an argument');
+ }
+
+ public function testOptions()
+ {
+ $input = new ArrayInput(array('--name' => 'foo'), new InputDefinition(array(new InputOption('name'))));
+ $this->assertEquals('foo', $input->getOption('name'), '->getOption() returns the value for the given option');
+
+ $input->setOption('name', 'bar');
+ $this->assertEquals('bar', $input->getOption('name'), '->setOption() sets the value for a given option');
+ $this->assertEquals(array('name' => 'bar'), $input->getOptions(), '->getOptions() returns all option values');
+
+ $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');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The "foo" option does not exist.
+ */
+ public function testSetInvalidOption()
+ {
+ $input = new ArrayInput(array('--name' => 'foo'), new InputDefinition(array(new InputOption('name'), new InputOption('bar', '', InputOption::VALUE_OPTIONAL, '', 'default'))));
+ $input->setOption('foo', 'bar');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The "foo" option does not exist.
+ */
+ public function testGetInvalidOption()
+ {
+ $input = new ArrayInput(array('--name' => 'foo'), new InputDefinition(array(new InputOption('name'), new InputOption('bar', '', InputOption::VALUE_OPTIONAL, '', 'default'))));
+ $input->getOption('foo');
+ }
+
+ public function testArguments()
+ {
+ $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name'))));
+ $this->assertEquals('foo', $input->getArgument('name'), '->getArgument() returns the value for the given argument');
+
+ $input->setArgument('name', 'bar');
+ $this->assertEquals('bar', $input->getArgument('name'), '->setArgument() sets the value for a given argument');
+ $this->assertEquals(array('name' => 'bar'), $input->getArguments(), '->getArguments() returns all argument values');
+
+ $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name'), new InputArgument('bar', InputArgument::OPTIONAL, '', 'default'))));
+ $this->assertEquals('default', $input->getArgument('bar'), '->getArgument() returns the default value for optional arguments');
+ $this->assertEquals(array('name' => 'foo', 'bar' => 'default'), $input->getArguments(), '->getArguments() returns all argument values, even optional ones');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The "foo" argument does not exist.
+ */
+ public function testSetInvalidArgument()
+ {
+ $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name'), new InputArgument('bar', InputArgument::OPTIONAL, '', 'default'))));
+ $input->setArgument('foo', 'bar');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The "foo" argument does not exist.
+ */
+ public function testGetInvalidArgument()
+ {
+ $input = new ArrayInput(array('name' => 'foo'), new InputDefinition(array(new InputArgument('name'), new InputArgument('bar', InputArgument::OPTIONAL, '', 'default'))));
+ $input->getArgument('foo');
+ }
+
+ /**
+ * @expectedException \RuntimeException
+ * @expectedExceptionMessage Not enough arguments (missing: "name").
+ */
+ public function testValidateWithMissingArguments()
+ {
+ $input = new ArrayInput(array());
+ $input->bind(new InputDefinition(array(new InputArgument('name', InputArgument::REQUIRED))));
+ $input->validate();
+ }
+
+ /**
+ * @expectedException \RuntimeException
+ * @expectedExceptionMessage Not enough arguments (missing: "name").
+ */
+ public function testValidateWithMissingRequiredArguments()
+ {
+ $input = new ArrayInput(array('bar' => 'baz'));
+ $input->bind(new InputDefinition(array(new InputArgument('name', InputArgument::REQUIRED), new InputArgument('bar', InputArgument::OPTIONAL))));
+ $input->validate();
+ }
+
+ public function testValidate()
+ {
+ $input = new ArrayInput(array('name' => 'foo'));
+ $input->bind(new InputDefinition(array(new InputArgument('name', InputArgument::REQUIRED))));
+
+ $this->assertNull($input->validate());
+ }
+
+ public function testSetGetInteractive()
+ {
+ $input = new ArrayInput(array());
+ $this->assertTrue($input->isInteractive(), '->isInteractive() returns whether the input should be interactive or not');
+ $input->setInteractive(false);
+ $this->assertFalse($input->isInteractive(), '->setInteractive() changes the interactive flag');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Input/StringInputTest.php b/vendor/symfony/console/Tests/Input/StringInputTest.php
new file mode 100644
index 00000000..c8a560f6
--- /dev/null
+++ b/vendor/symfony/console/Tests/Input/StringInputTest.php
@@ -0,0 +1,99 @@
+<?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\Input;
+
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\StringInput;
+
+class StringInputTest extends \PHPUnit_Framework_TestCase
+{
+ /**
+ * @dataProvider getTokenizeData
+ */
+ public function testTokenize($input, $tokens, $message)
+ {
+ $input = new StringInput($input);
+ $r = new \ReflectionClass('Symfony\Component\Console\Input\ArgvInput');
+ $p = $r->getProperty('tokens');
+ $p->setAccessible(true);
+ $this->assertEquals($tokens, $p->getValue($input), $message);
+ }
+
+ public function testInputOptionWithGivenString()
+ {
+ $definition = new InputDefinition(
+ array(new InputOption('foo', null, InputOption::VALUE_REQUIRED))
+ );
+
+ // call to bind
+ $input = new StringInput('--foo=bar');
+ $input->bind($definition);
+ $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(
+ array('', array(), '->tokenize() parses an empty string'),
+ array('foo', array('foo'), '->tokenize() parses arguments'),
+ array(' foo bar ', array('foo', 'bar'), '->tokenize() ignores whitespaces between arguments'),
+ array('"quoted"', array('quoted'), '->tokenize() parses quoted arguments'),
+ array("'quoted'", array('quoted'), '->tokenize() parses quoted arguments'),
+ array("'a\rb\nc\td'", array("a\rb\nc\td"), '->tokenize() parses whitespace chars in strings'),
+ array("'a'\r'b'\n'c'\t'd'", array('a', 'b', 'c', 'd'), '->tokenize() parses whitespace chars between args as spaces'),
+ array('\"quoted\"', array('"quoted"'), '->tokenize() parses escaped-quoted arguments'),
+ array("\'quoted\'", array('\'quoted\''), '->tokenize() parses escaped-quoted arguments'),
+ array('-a', array('-a'), '->tokenize() parses short options'),
+ array('-azc', array('-azc'), '->tokenize() parses aggregated short options'),
+ array('-awithavalue', array('-awithavalue'), '->tokenize() parses short options with a value'),
+ array('-a"foo bar"', array('-afoo bar'), '->tokenize() parses short options with a value'),
+ array('-a"foo bar""foo bar"', array('-afoo barfoo bar'), '->tokenize() parses short options with a value'),
+ array('-a\'foo bar\'', array('-afoo bar'), '->tokenize() parses short options with a value'),
+ array('-a\'foo bar\'\'foo bar\'', array('-afoo barfoo bar'), '->tokenize() parses short options with a value'),
+ array('-a\'foo bar\'"foo bar"', array('-afoo barfoo bar'), '->tokenize() parses short options with a value'),
+ array('--long-option', array('--long-option'), '->tokenize() parses long options'),
+ array('--long-option=foo', array('--long-option=foo'), '->tokenize() parses long options with a value'),
+ array('--long-option="foo bar"', array('--long-option=foo bar'), '->tokenize() parses long options with a value'),
+ array('--long-option="foo bar""another"', array('--long-option=foo baranother'), '->tokenize() parses long options with a value'),
+ array('--long-option=\'foo bar\'', array('--long-option=foo bar'), '->tokenize() parses long options with a value'),
+ array("--long-option='foo bar''another'", array('--long-option=foo baranother'), '->tokenize() parses long options with a value'),
+ array("--long-option='foo bar'\"another\"", array('--long-option=foo baranother'), '->tokenize() parses long options with a value'),
+ array('foo -a -ffoo --long bar', array('foo', '-a', '-ffoo', '--long', 'bar'), '->tokenize() parses when several arguments and options'),
+ );
+ }
+
+ public function testToString()
+ {
+ $input = new StringInput('-f foo');
+ $this->assertEquals('-f foo', (string) $input);
+
+ $input = new StringInput('-f --bar=foo "a b c d"');
+ $this->assertEquals('-f --bar=foo '.escapeshellarg('a b c d'), (string) $input);
+
+ $input = new StringInput('-f --bar=foo \'a b c d\' '."'A\nB\\'C'");
+ $this->assertEquals('-f --bar=foo '.escapeshellarg('a b c d').' '.escapeshellarg("A\nB'C"), (string) $input);
+ }
+}
diff --git a/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php b/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php
new file mode 100644
index 00000000..c5eca2ca
--- /dev/null
+++ b/vendor/symfony/console/Tests/Logger/ConsoleLoggerTest.php
@@ -0,0 +1,58 @@
+<?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\Logger;
+
+use Psr\Log\Test\LoggerInterfaceTest;
+use Psr\Log\LogLevel;
+use Symfony\Component\Console\Logger\ConsoleLogger;
+use Symfony\Component\Console\Tests\Fixtures\DummyOutput;
+use Symfony\Component\Console\Output\OutputInterface;
+
+/**
+ * Console logger test.
+ *
+ * @author Kévin Dunglas <dunglas@gmail.com>
+ */
+class ConsoleLoggerTest extends LoggerInterfaceTest
+{
+ /**
+ * @var DummyOutput
+ */
+ protected $output;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getLogger()
+ {
+ $this->output = new DummyOutput(OutputInterface::VERBOSITY_VERBOSE);
+
+ return new ConsoleLogger($this->output, array(
+ LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL,
+ LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL,
+ LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL,
+ LogLevel::ERROR => OutputInterface::VERBOSITY_NORMAL,
+ LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL,
+ LogLevel::NOTICE => OutputInterface::VERBOSITY_NORMAL,
+ LogLevel::INFO => OutputInterface::VERBOSITY_NORMAL,
+ LogLevel::DEBUG => OutputInterface::VERBOSITY_NORMAL,
+ ));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getLogs()
+ {
+ return $this->output->getLogs();
+ }
+}
diff --git a/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php b/vendor/symfony/console/Tests/Output/ConsoleOutputTest.php
new file mode 100644
index 00000000..1afbbb6e
--- /dev/null
+++ b/vendor/symfony/console/Tests/Output/ConsoleOutputTest.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\Output;
+
+use Symfony\Component\Console\Output\ConsoleOutput;
+use Symfony\Component\Console\Output\Output;
+
+class ConsoleOutputTest extends \PHPUnit_Framework_TestCase
+{
+ public function testConstructor()
+ {
+ $output = new ConsoleOutput(Output::VERBOSITY_QUIET, true);
+ $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');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Output/NullOutputTest.php b/vendor/symfony/console/Tests/Output/NullOutputTest.php
new file mode 100644
index 00000000..b20ae4e8
--- /dev/null
+++ b/vendor/symfony/console/Tests/Output/NullOutputTest.php
@@ -0,0 +1,39 @@
+<?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\Output;
+
+use Symfony\Component\Console\Output\NullOutput;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class NullOutputTest extends \PHPUnit_Framework_TestCase
+{
+ public function testConstructor()
+ {
+ $output = new NullOutput();
+
+ ob_start();
+ $output->write('foo');
+ $buffer = ob_get_clean();
+
+ $this->assertSame('', $buffer, '->write() does nothing (at least nothing is printed)');
+ $this->assertFalse($output->isDecorated(), '->isDecorated() returns false');
+ }
+
+ public function testVerbosity()
+ {
+ $output = new NullOutput();
+ $this->assertSame(OutputInterface::VERBOSITY_QUIET, $output->getVerbosity(), '->getVerbosity() returns VERBOSITY_QUIET for NullOutput by default');
+
+ $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
+ $this->assertSame(OutputInterface::VERBOSITY_QUIET, $output->getVerbosity(), '->getVerbosity() always returns VERBOSITY_QUIET for NullOutput');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Output/OutputTest.php b/vendor/symfony/console/Tests/Output/OutputTest.php
new file mode 100644
index 00000000..45e6ddc7
--- /dev/null
+++ b/vendor/symfony/console/Tests/Output/OutputTest.php
@@ -0,0 +1,175 @@
+<?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\Output;
+
+use Symfony\Component\Console\Output\Output;
+use Symfony\Component\Console\Formatter\OutputFormatterStyle;
+
+class OutputTest extends \PHPUnit_Framework_TestCase
+{
+ public function testConstructor()
+ {
+ $output = new TestOutput(Output::VERBOSITY_QUIET, true);
+ $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument');
+ $this->assertTrue($output->isDecorated(), '__construct() takes the decorated flag as its second argument');
+ }
+
+ public function testSetIsDecorated()
+ {
+ $output = new TestOutput();
+ $output->setDecorated(true);
+ $this->assertTrue($output->isDecorated(), 'setDecorated() sets the decorated flag');
+ }
+
+ public function testSetGetVerbosity()
+ {
+ $output = new TestOutput();
+ $output->setVerbosity(Output::VERBOSITY_QUIET);
+ $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '->setVerbosity() sets the verbosity');
+
+ $this->assertTrue($output->isQuiet());
+ $this->assertFalse($output->isVerbose());
+ $this->assertFalse($output->isVeryVerbose());
+ $this->assertFalse($output->isDebug());
+
+ $output->setVerbosity(Output::VERBOSITY_NORMAL);
+ $this->assertFalse($output->isQuiet());
+ $this->assertFalse($output->isVerbose());
+ $this->assertFalse($output->isVeryVerbose());
+ $this->assertFalse($output->isDebug());
+
+ $output->setVerbosity(Output::VERBOSITY_VERBOSE);
+ $this->assertFalse($output->isQuiet());
+ $this->assertTrue($output->isVerbose());
+ $this->assertFalse($output->isVeryVerbose());
+ $this->assertFalse($output->isDebug());
+
+ $output->setVerbosity(Output::VERBOSITY_VERY_VERBOSE);
+ $this->assertFalse($output->isQuiet());
+ $this->assertTrue($output->isVerbose());
+ $this->assertTrue($output->isVeryVerbose());
+ $this->assertFalse($output->isDebug());
+
+ $output->setVerbosity(Output::VERBOSITY_DEBUG);
+ $this->assertFalse($output->isQuiet());
+ $this->assertTrue($output->isVerbose());
+ $this->assertTrue($output->isVeryVerbose());
+ $this->assertTrue($output->isDebug());
+ }
+
+ public function testWriteWithVerbosityQuiet()
+ {
+ $output = new TestOutput(Output::VERBOSITY_QUIET);
+ $output->writeln('foo');
+ $this->assertEquals('', $output->output, '->writeln() outputs nothing if verbosity is set to VERBOSITY_QUIET');
+ }
+
+ public function testWriteAnArrayOfMessages()
+ {
+ $output = new TestOutput();
+ $output->writeln(array('foo', 'bar'));
+ $this->assertEquals("foo\nbar\n", $output->output, '->writeln() can take an array of messages to output');
+ }
+
+ /**
+ * @dataProvider provideWriteArguments
+ */
+ public function testWriteRawMessage($message, $type, $expectedOutput)
+ {
+ $output = new TestOutput();
+ $output->writeln($message, $type);
+ $this->assertEquals($expectedOutput, $output->output);
+ }
+
+ public function provideWriteArguments()
+ {
+ return array(
+ array('<info>foo</info>', Output::OUTPUT_RAW, "<info>foo</info>\n"),
+ array('<info>foo</info>', Output::OUTPUT_PLAIN, "foo\n"),
+ );
+ }
+
+ public function testWriteWithDecorationTurnedOff()
+ {
+ $output = new TestOutput();
+ $output->setDecorated(false);
+ $output->writeln('<info>foo</info>');
+ $this->assertEquals("foo\n", $output->output, '->writeln() strips decoration tags if decoration is set to false');
+ }
+
+ public function testWriteDecoratedMessage()
+ {
+ $fooStyle = new OutputFormatterStyle('yellow', 'red', array('blink'));
+ $output = new TestOutput();
+ $output->getFormatter()->setStyle('FOO', $fooStyle);
+ $output->setDecorated(true);
+ $output->writeln('<foo>foo</foo>');
+ $this->assertEquals("\033[33;41;5mfoo\033[39;49;25m\n", $output->output, '->writeln() decorates the output');
+ }
+
+ public function testWriteWithInvalidStyle()
+ {
+ $output = new TestOutput();
+
+ $output->clear();
+ $output->write('<bar>foo</bar>');
+ $this->assertEquals('<bar>foo</bar>', $output->output, '->write() do nothing when a style does not exist');
+
+ $output->clear();
+ $output->writeln('<bar>foo</bar>');
+ $this->assertEquals("<bar>foo</bar>\n", $output->output, '->writeln() do nothing when a style does not exist');
+ }
+
+ /**
+ * @dataProvider verbosityProvider
+ */
+ public function testWriteWithVerbosityOption($verbosity, $expected, $msg)
+ {
+ $output = new TestOutput();
+
+ $output->setVerbosity($verbosity);
+ $output->clear();
+ $output->write('1', false);
+ $output->write('2', false, Output::VERBOSITY_QUIET);
+ $output->write('3', false, Output::VERBOSITY_NORMAL);
+ $output->write('4', false, Output::VERBOSITY_VERBOSE);
+ $output->write('5', false, Output::VERBOSITY_VERY_VERBOSE);
+ $output->write('6', false, Output::VERBOSITY_DEBUG);
+ $this->assertEquals($expected, $output->output, $msg);
+ }
+
+ public function verbosityProvider()
+ {
+ return array(
+ array(Output::VERBOSITY_QUIET, '2', '->write() in QUIET mode only outputs when an explicit QUIET verbosity is passed'),
+ array(Output::VERBOSITY_NORMAL, '123', '->write() in NORMAL mode outputs anything below an explicit VERBOSE verbosity'),
+ array(Output::VERBOSITY_VERBOSE, '1234', '->write() in VERBOSE mode outputs anything below an explicit VERY_VERBOSE verbosity'),
+ array(Output::VERBOSITY_VERY_VERBOSE, '12345', '->write() in VERY_VERBOSE mode outputs anything below an explicit DEBUG verbosity'),
+ array(Output::VERBOSITY_DEBUG, '123456', '->write() in DEBUG mode outputs everything'),
+ );
+ }
+}
+
+class TestOutput extends Output
+{
+ public $output = '';
+
+ public function clear()
+ {
+ $this->output = '';
+ }
+
+ protected function doWrite($message, $newline)
+ {
+ $this->output .= $message.($newline ? "\n" : '');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Output/StreamOutputTest.php b/vendor/symfony/console/Tests/Output/StreamOutputTest.php
new file mode 100644
index 00000000..2fd4f612
--- /dev/null
+++ b/vendor/symfony/console/Tests/Output/StreamOutputTest.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\Output;
+
+use Symfony\Component\Console\Output\Output;
+use Symfony\Component\Console\Output\StreamOutput;
+
+class StreamOutputTest extends \PHPUnit_Framework_TestCase
+{
+ protected $stream;
+
+ protected function setUp()
+ {
+ $this->stream = fopen('php://memory', 'a', false);
+ }
+
+ protected function tearDown()
+ {
+ $this->stream = null;
+ }
+
+ public function testConstructor()
+ {
+ $output = new StreamOutput($this->stream, Output::VERBOSITY_QUIET, true);
+ $this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument');
+ $this->assertTrue($output->isDecorated(), '__construct() takes the decorated flag as its second argument');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage The StreamOutput class needs a stream as its first argument.
+ */
+ public function testStreamIsRequired()
+ {
+ new StreamOutput('foo');
+ }
+
+ public function testGetStream()
+ {
+ $output = new StreamOutput($this->stream);
+ $this->assertEquals($this->stream, $output->getStream(), '->getStream() returns the current stream');
+ }
+
+ public function testDoWrite()
+ {
+ $output = new StreamOutput($this->stream);
+ $output->writeln('foo');
+ rewind($output->getStream());
+ $this->assertEquals('foo'.PHP_EOL, stream_get_contents($output->getStream()), '->doWrite() writes to the stream');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php b/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php
new file mode 100644
index 00000000..889a9c82
--- /dev/null
+++ b/vendor/symfony/console/Tests/Style/SymfonyStyleTest.php
@@ -0,0 +1,89 @@
+<?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\Style;
+
+use PHPUnit_Framework_TestCase;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+use Symfony\Component\Console\Tester\CommandTester;
+
+class SymfonyStyleTest extends PHPUnit_Framework_TestCase
+{
+ /** @var Command */
+ protected $command;
+ /** @var CommandTester */
+ protected $tester;
+
+ protected function setUp()
+ {
+ $this->command = new Command('sfstyle');
+ $this->tester = new CommandTester($this->command);
+ }
+
+ protected function tearDown()
+ {
+ $this->command = null;
+ $this->tester = null;
+ }
+
+ /**
+ * @dataProvider inputCommandToOutputFilesProvider
+ */
+ public function testOutputs($inputCommandFilepath, $outputFilepath)
+ {
+ $code = require $inputCommandFilepath;
+ $this->command->setCode($code);
+ $this->tester->execute(array(), array('interactive' => false, 'decorated' => false));
+ $this->assertStringEqualsFile($outputFilepath, $this->tester->getDisplay(true));
+ }
+
+ public function inputCommandToOutputFilesProvider()
+ {
+ $baseDir = __DIR__.'/../Fixtures/Style/SymfonyStyle';
+
+ return array_map(null, glob($baseDir.'/command/command_*.php'), glob($baseDir.'/output/output_*.txt'));
+ }
+
+ public function testLongWordsBlockWrapping()
+ {
+ $word = 'Lopadotemachoselachogaleokranioleipsanodrimhypotrimmatosilphioparaomelitokatakechymenokichlepikossyphophattoperisteralektryonoptekephalliokigklopeleiolagoiosiraiobaphetraganopterygovgollhjvhvljfezefeqifzeiqgiqzhrsdgihqzridghqridghqirshdghdghieridgheirhsdgehrsdvhqrsidhqshdgihrsidvqhneriqsdvjzergetsrfhgrstsfhsetsfhesrhdgtesfhbzrtfbrztvetbsdfbrsdfbrn';
+ $wordLength = strlen($word);
+ $maxLineLength = SymfonyStyle::MAX_LINE_LENGTH - 3;
+
+ $this->command->setCode(function (InputInterface $input, OutputInterface $output) use ($word) {
+ $sfStyle = new SymfonyStyleWithForcedLineLength($input, $output);
+ $sfStyle->block($word, 'CUSTOM', 'fg=white;bg=blue', ' § ', false);
+ });
+
+ $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), ' § '));
+ }
+}
+
+/**
+ * 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)
+ {
+ parent::__construct($input, $output);
+
+ $ref = new \ReflectionProperty(get_parent_class($this), 'lineLength');
+ $ref->setAccessible(true);
+ $ref->setValue($this, 120);
+ }
+}
diff --git a/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php b/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php
new file mode 100644
index 00000000..a8389dd1
--- /dev/null
+++ b/vendor/symfony/console/Tests/Tester/ApplicationTesterTest.php
@@ -0,0 +1,69 @@
+<?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\Tester;
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Output\Output;
+use Symfony\Component\Console\Tester\ApplicationTester;
+
+class ApplicationTesterTest extends \PHPUnit_Framework_TestCase
+{
+ protected $application;
+ protected $tester;
+
+ protected function setUp()
+ {
+ $this->application = new Application();
+ $this->application->setAutoExit(false);
+ $this->application->register('foo')
+ ->addArgument('foo')
+ ->setCode(function ($input, $output) { $output->writeln('foo'); })
+ ;
+
+ $this->tester = new ApplicationTester($this->application);
+ $this->tester->run(array('command' => 'foo', 'foo' => 'bar'), array('interactive' => false, 'decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE));
+ }
+
+ protected function tearDown()
+ {
+ $this->application = null;
+ $this->tester = null;
+ }
+
+ public function testRun()
+ {
+ $this->assertFalse($this->tester->getInput()->isInteractive(), '->execute() takes an interactive option');
+ $this->assertFalse($this->tester->getOutput()->isDecorated(), '->execute() takes a decorated option');
+ $this->assertEquals(Output::VERBOSITY_VERBOSE, $this->tester->getOutput()->getVerbosity(), '->execute() takes a verbosity option');
+ }
+
+ public function testGetInput()
+ {
+ $this->assertEquals('bar', $this->tester->getInput()->getArgument('foo'), '->getInput() returns the current input instance');
+ }
+
+ public function testGetOutput()
+ {
+ rewind($this->tester->getOutput()->getStream());
+ $this->assertEquals('foo'.PHP_EOL, stream_get_contents($this->tester->getOutput()->getStream()), '->getOutput() returns the current output instance');
+ }
+
+ public function testGetDisplay()
+ {
+ $this->assertEquals('foo'.PHP_EOL, $this->tester->getDisplay(), '->getDisplay() returns the display of the last execution');
+ }
+
+ public function testGetStatusCode()
+ {
+ $this->assertSame(0, $this->tester->getStatusCode(), '->getStatusCode() returns the status code');
+ }
+}
diff --git a/vendor/symfony/console/Tests/Tester/CommandTesterTest.php b/vendor/symfony/console/Tests/Tester/CommandTesterTest.php
new file mode 100644
index 00000000..b54c00e8
--- /dev/null
+++ b/vendor/symfony/console/Tests/Tester/CommandTesterTest.php
@@ -0,0 +1,84 @@
+<?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\Tester;
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Output\Output;
+use Symfony\Component\Console\Tester\CommandTester;
+
+class CommandTesterTest extends \PHPUnit_Framework_TestCase
+{
+ protected $command;
+ protected $tester;
+
+ protected function setUp()
+ {
+ $this->command = new Command('foo');
+ $this->command->addArgument('command');
+ $this->command->addArgument('foo');
+ $this->command->setCode(function ($input, $output) { $output->writeln('foo'); });
+
+ $this->tester = new CommandTester($this->command);
+ $this->tester->execute(array('foo' => 'bar'), array('interactive' => false, 'decorated' => false, 'verbosity' => Output::VERBOSITY_VERBOSE));
+ }
+
+ protected function tearDown()
+ {
+ $this->command = null;
+ $this->tester = null;
+ }
+
+ public function testExecute()
+ {
+ $this->assertFalse($this->tester->getInput()->isInteractive(), '->execute() takes an interactive option');
+ $this->assertFalse($this->tester->getOutput()->isDecorated(), '->execute() takes a decorated option');
+ $this->assertEquals(Output::VERBOSITY_VERBOSE, $this->tester->getOutput()->getVerbosity(), '->execute() takes a verbosity option');
+ }
+
+ public function testGetInput()
+ {
+ $this->assertEquals('bar', $this->tester->getInput()->getArgument('foo'), '->getInput() returns the current input instance');
+ }
+
+ public function testGetOutput()
+ {
+ rewind($this->tester->getOutput()->getStream());
+ $this->assertEquals('foo'.PHP_EOL, stream_get_contents($this->tester->getOutput()->getStream()), '->getOutput() returns the current output instance');
+ }
+
+ public function testGetDisplay()
+ {
+ $this->assertEquals('foo'.PHP_EOL, $this->tester->getDisplay(), '->getDisplay() returns the display of the last execution');
+ }
+
+ public function testGetStatusCode()
+ {
+ $this->assertSame(0, $this->tester->getStatusCode(), '->getStatusCode() returns the status code');
+ }
+
+ public function testCommandFromApplication()
+ {
+ $application = new Application();
+ $application->setAutoExit(false);
+
+ $command = new Command('foo');
+ $command->setCode(function ($input, $output) { $output->writeln('foo'); });
+
+ $application->add($command);
+
+ $tester = new CommandTester($application->find('foo'));
+
+ // check that there is no need to pass the command name here
+ $this->assertEquals(0, $tester->execute(array()));
+ }
+}