summaryrefslogtreecommitdiffstats
path: root/vendor/symfony/console/Symfony/Component/Console/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/console/Symfony/Component/Console/Tests')
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/ApplicationTest.php1060
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Command/CommandTest.php348
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Command/HelpCommandTest.php64
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Command/ListCommandTest.php64
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/AbstractDescriptorTest.php105
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/JsonDescriptorTest.php27
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/MarkdownDescriptorTest.php27
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/ObjectsProvider.php74
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/TextDescriptorTest.php27
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/XmlDescriptorTest.php27
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/BarBucCommand.php11
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/DescriptorApplication1.php18
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/DescriptorApplication2.php24
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/DescriptorCommand1.php27
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/DescriptorCommand2.php30
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/DummyOutput.php36
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo1Command.php26
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo2Command.php21
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php29
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo4Command.php11
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo5Command.php10
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/FooCommand.php33
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/FooSubnamespaced1Command.php26
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/FooSubnamespaced2Command.php26
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/FoobarCommand.php25
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/TestCommand.php28
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.md199
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.txt17
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.xml108
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.md388
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.txt22
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.xml185
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt20
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt16
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt144
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt37
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_gethelp.txt1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt8
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt11
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception3.txt27
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception3decorated.txt27
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt9
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth1.txt11
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt11
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth2.txt12
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run1.txt17
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run2.txt29
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run3.txt27
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run4.txt1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.md8
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.txt7
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.xml12
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_2.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_2.md30
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_2.txt11
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_2.xml18
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_astext.txt18
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt38
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt11
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/definition_asxml.txt39
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_1.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_1.md7
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_1.txt1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_1.xml5
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_2.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_2.md7
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_2.txt1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_2.xml5
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_3.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_3.md7
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_3.txt1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_3.xml7
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_1.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_1.md0
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_1.txt0
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_1.xml5
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_2.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_2.md9
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_2.txt2
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_2.xml10
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_3.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_3.md11
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_3.txt2
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_3.xml9
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_4.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_4.md21
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_4.txt5
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_4.xml14
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_1.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_1.md9
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_1.txt1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_1.xml4
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_2.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_2.md9
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_2.txt1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_2.xml7
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_3.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_3.md9
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_3.txt1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_3.xml5
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_4.json1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_4.md9
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_4.txt1
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_4.xml5
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleStackTest.php70
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php93
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php257
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php99
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Helper/HelperSetTest.php153
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Helper/LegacyDialogHelperTest.php200
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Helper/LegacyProgressHelperTest.php232
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php325
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProcessHelperTest.php118
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php598
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php238
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Helper/TableTest.php357
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Input/ArgvInputTest.php317
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Input/ArrayInputTest.php138
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputArgumentTest.php111
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php430
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputOptionTest.php204
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputTest.php121
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Input/StringInputTest.php101
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Logger/ConsoleLoggerTest.php58
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Output/ConsoleOutputTest.php25
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Output/NullOutputTest.php39
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Output/OutputTest.php156
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Output/StreamOutputTest.php60
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Tester/ApplicationTesterTest.php69
-rw-r--r--vendor/symfony/console/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php84
133 files changed, 8581 insertions, 0 deletions
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/ApplicationTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/ApplicationTest.php
new file mode 100644
index 0000000..1fa6c64
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/ApplicationTest.php
@@ -0,0 +1,1060 @@
+<?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 \InvalidArgumentException
+ * @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 \InvalidArgumentException
+ * @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 \InvalidArgumentException
+ * @expectedExceptionMessage There are no commands defined in the "bar" namespace.
+ */
+ public function testFindInvalidNamespace()
+ {
+ $application = new Application();
+ $application->findNamespace('bar');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @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('InvalidArgumentException', $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 \InvalidArgumentException
+ * @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 an \InvalidArgumentException if command does not exist, with alternatives');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
+ $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws an \InvalidArgumentException 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 an \InvalidArgumentException if command does not exist, with alternatives');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
+ $this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws an \InvalidArgumentException 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 \InvalidArgumentException if a command is ambiguous because of a subnamespace, with alternatives');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('\InvalidArgumentException', $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 an \InvalidArgumentException if command does not exist');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist');
+ $this->assertEquals(sprintf('Command "%s" is not defined.', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, without alternatives');
+ }
+
+ // Test if "bar1" command throw an "\InvalidArgumentException" 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 an \InvalidArgumentException if command does not exist');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist');
+ $this->assertRegExp(sprintf('/Command "%s" is not defined./', $commandName), $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternatives');
+ $this->assertRegExp('/afoobar1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "afoobar1"');
+ $this->assertRegExp('/foo:bar1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if command does not exist, with alternative : "foo:bar1"');
+ $this->assertNotRegExp('/foo:bar(?>!1)/', $e->getMessage(), '->find() throws an \InvalidArgumentException 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 an \InvalidArgumentException if namespace does not exist');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if namespace does not exist');
+ $this->assertEquals('There are no commands defined in the "Unknown-namespace" namespace.', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, without alternatives');
+ }
+
+ try {
+ $application->find('foo2:command');
+ $this->fail('->find() throws an \InvalidArgumentException if namespace does not exist');
+ } catch (\Exception $e) {
+ $this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if namespace does not exist');
+ $this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative');
+ $this->assertRegExp('/foo/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo"');
+ $this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, with alternative : "foo1"');
+ $this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws an \InvalidArgumentException 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 \InvalidArgumentException
+ * @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()
+ {
+ $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
+
+ $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()
+ {
+ $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
+
+ $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
+ * @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.', $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.after.caught.', $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 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()->write('after.');
+
+ if (!$skipCommand) {
+ $event->setExitCode(113);
+ }
+ });
+ $dispatcher->addListener('console.exception', function (ConsoleExceptionEvent $event) {
+ $event->getOutput()->writeln('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');
+ }
+
+ public function testCanCheckIfTerminalIsInteractive()
+ {
+ if (!function_exists('posix_isatty')) {
+ $this->markTestSkipped('posix_isatty function is required');
+ }
+
+ $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/Symfony/Component/Console/Tests/Command/CommandTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Command/CommandTest.php
new file mode 100644
index 0000000..c35617d
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Command/CommandTest.php
@@ -0,0 +1,348 @@
+<?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');
+ }
+
+ 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%');
+ }
+
+ 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('foo');
+ $this->assertEquals('namespace:name [--foo] [foo]', $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');
+ }
+
+ public function testGet()
+ {
+ $application = new Application();
+ $command = new \TestCommand();
+ $command->setApplication($application);
+ $formatterHelper = new FormatterHelper();
+ $this->assertEquals($formatterHelper->getName(), $command->getHelper('formatter')->getName(), '->__get() returns the correct helper');
+ }
+
+ 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 \InvalidArgumentException
+ * @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 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 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()
+ {
+ $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
+
+ $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()
+ {
+ $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
+
+ $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');
+ }
+}
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Command/HelpCommandTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Command/HelpCommandTest.php
new file mode 100644
index 0000000..ea69c8b
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Command/HelpCommandTest.php
@@ -0,0 +1,64 @@
+<?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'));
+ $this->assertRegExp('/list \[--xml\] \[--raw\] \[--format="\.\.\."\] \[namespace\]/', $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());
+ $this->assertRegExp('/list \[--xml\] \[--raw\] \[--format="\.\.\."\] \[namespace\]/', $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->assertRegExp('/<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->assertRegExp('/list \[--xml\] \[--raw\] \[--format="\.\.\."\] \[namespace\]/', $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->assertRegExp('/list \[--xml\] \[--raw\] \[--format="\.\.\."\] \[namespace\]/', $commandTester->getDisplay(), '->execute() returns a text help for the given command');
+ $this->assertRegExp('/<command/', $commandTester->getDisplay(), '->execute() returns an XML help text if --format=xml is passed');
+ }
+}
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Command/ListCommandTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Command/ListCommandTest.php
new file mode 100644
index 0000000..fbb9fee
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Command/ListCommandTest.php
@@ -0,0 +1,64 @@
+<?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 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));
+ }
+}
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/AbstractDescriptorTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/AbstractDescriptorTest.php
new file mode 100644
index 0000000..406c659
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/AbstractDescriptorTest.php
@@ -0,0 +1,105 @@
+<?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;
+ }
+
+ private 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/Symfony/Component/Console/Tests/Descriptor/JsonDescriptorTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/JsonDescriptorTest.php
new file mode 100644
index 0000000..943ea29
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/JsonDescriptorTest.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\JsonDescriptor;
+
+class JsonDescriptorTest extends AbstractDescriptorTest
+{
+ protected function getDescriptor()
+ {
+ return new JsonDescriptor();
+ }
+
+ protected function getFormat()
+ {
+ return 'json';
+ }
+}
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/MarkdownDescriptorTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/MarkdownDescriptorTest.php
new file mode 100644
index 0000000..c85e8a5
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Descriptor/ObjectsProvider.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/ObjectsProvider.php
new file mode 100644
index 0000000..a3c49d7
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/ObjectsProvider.php
@@ -0,0 +1,74 @@
+<?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'),
+ );
+ }
+
+ 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()),
+ );
+ }
+
+ 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/Symfony/Component/Console/Tests/Descriptor/TextDescriptorTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/TextDescriptorTest.php
new file mode 100644
index 0000000..350b679
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Descriptor/XmlDescriptorTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Descriptor/XmlDescriptorTest.php
new file mode 100644
index 0000000..59a5d1e
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/BarBucCommand.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/BarBucCommand.php
new file mode 100644
index 0000000..52b619e
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/DescriptorApplication1.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/DescriptorApplication1.php
new file mode 100644
index 0000000..132b6d5
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/DescriptorApplication2.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/DescriptorApplication2.php
new file mode 100644
index 0000000..ff55135
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/DescriptorCommand1.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/DescriptorCommand1.php
new file mode 100644
index 0000000..ede05d7
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/DescriptorCommand2.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/DescriptorCommand2.php
new file mode 100644
index 0000000..bc04ca9
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/DescriptorCommand2.php
@@ -0,0 +1,30 @@
+<?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')
+ ->addArgument('argument_name', InputArgument::REQUIRED)
+ ->addOption('option_name', 'o', InputOption::VALUE_NONE)
+ ;
+ }
+}
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/DummyOutput.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/DummyOutput.php
new file mode 100644
index 0000000..aef6d22
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/Foo1Command.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo1Command.php
new file mode 100644
index 0000000..254162f
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/Foo2Command.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo2Command.php
new file mode 100644
index 0000000..8071dc8
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php
new file mode 100644
index 0000000..6c890fa
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/Foo4Command.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo4Command.php
new file mode 100644
index 0000000..1c54639
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/Foo5Command.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/Foo5Command.php
new file mode 100644
index 0000000..a1c6082
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/FooCommand.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/FooCommand.php
new file mode 100644
index 0000000..355e0ad
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/FooSubnamespaced1Command.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/FooSubnamespaced1Command.php
new file mode 100644
index 0000000..fc50c72
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/FooSubnamespaced2Command.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/FooSubnamespaced2Command.php
new file mode 100644
index 0000000..1cf31ff
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/FoobarCommand.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/FoobarCommand.php
new file mode 100644
index 0000000..9681628
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/TestCommand.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/TestCommand.php
new file mode 100644
index 0000000..dcd3273
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/application_1.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.json
new file mode 100644
index 0000000..7f8d92e
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.json
@@ -0,0 +1 @@
+{"commands":[{"name":"help","usage":"help [--xml] [--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.","aliases":[],"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":"To output help in other formats","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=\"...\"] [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>","aliases":[],"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":"To output list in other formats","default":"txt"}}}}],"namespaces":[{"id":"_global","commands":["help","list"]}]}
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.md
new file mode 100644
index 0000000..e380416
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.md
@@ -0,0 +1,199 @@
+UNKNOWN
+=======
+
+* help
+* list
+
+help
+----
+
+* Description: Displays help for a command
+* Usage: `help [--xml] [--format="..."] [--raw] [command_name]`
+* Aliases: <none>
+
+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: To output help in other formats
+* 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="..."] [namespace]`
+* Aliases: <none>
+
+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: To output list in other formats
+* Default: `'txt'`
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.txt
new file mode 100644
index 0000000..f3a1968
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.txt
@@ -0,0 +1,17 @@
+<info>Console Tool</info>
+
+<comment>Usage:</comment>
+ command [options] [arguments]
+
+<comment>Options:</comment>
+ <info>--help</info> (-h) Display this help message
+ <info>--quiet</info> (-q) Do not output any message
+ <info>--verbose</info> (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
+ <info>--version</info> (-V) Display this application version
+ <info>--ansi</info> Force ANSI output
+ <info>--no-ansi</info> Disable ANSI output
+ <info>--no-interaction</info> (-n) Do not ask any interactive question
+
+<comment>Available commands:</comment>
+ <info>help </info> Displays help for a command
+ <info>list </info> Lists commands
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.xml
new file mode 100644
index 0000000..1763108
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_1.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<symfony>
+ <commands>
+ <command id="help" name="help">
+ <usage>help [--xml] [--format="..."] [--raw] [command_name]</usage>
+ <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>
+ <aliases/>
+ <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>To output help in other formats</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">
+ <usage>list [--xml] [--raw] [--format="..."] [namespace]</usage>
+ <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>
+ <aliases/>
+ <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>To output list in other formats</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/Symfony/Component/Console/Tests/Fixtures/application_2.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.json
new file mode 100644
index 0000000..1655d47
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.json
@@ -0,0 +1 @@
+{"commands":[{"name":"help","usage":"help [--xml] [--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.","aliases":[],"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":"To output help in other formats","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=\"...\"] [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>","aliases":[],"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":"To output list in other formats","default":"txt"}}}},{"name":"descriptor:command1","usage":"descriptor:command1","description":"command 1 description","help":"command 1 help","aliases":["alias1","alias2"],"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","description":"command 2 description","help":"command 2 help","aliases":[],"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"]}]}
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.md
new file mode 100644
index 0000000..7492886
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.md
@@ -0,0 +1,388 @@
+My Symfony application
+======================
+
+* alias1
+* alias2
+* help
+* list
+
+**descriptor:**
+
+* descriptor:command1
+* descriptor:command2
+
+help
+----
+
+* Description: Displays help for a command
+* Usage: `help [--xml] [--format="..."] [--raw] [command_name]`
+* Aliases: <none>
+
+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: To output help in other formats
+* 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="..."] [namespace]`
+* Aliases: <none>
+
+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: To output list in other formats
+* Default: `'txt'`
+
+descriptor:command1
+-------------------
+
+* Description: command 1 description
+* Usage: `descriptor:command1`
+* Aliases: `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`
+* Aliases: <none>
+
+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/Symfony/Component/Console/Tests/Fixtures/application_2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.txt
new file mode 100644
index 0000000..a640a8d
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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>--help</info> (-h) Display this help message
+ <info>--quiet</info> (-q) Do not output any message
+ <info>--verbose</info> (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
+ <info>--version</info> (-V) Display this application version
+ <info>--ansi</info> Force ANSI output
+ <info>--no-ansi</info> Disable ANSI output
+ <info>--no-interaction</info> (-n) Do not ask any interactive question
+
+<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/Symfony/Component/Console/Tests/Fixtures/application_2.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.xml
new file mode 100644
index 0000000..a7d65b4
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_2.xml
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<symfony name="My Symfony application" version="v1.0">
+ <commands>
+ <command id="help" name="help">
+ <usage>help [--xml] [--format="..."] [--raw] [command_name]</usage>
+ <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>
+ <aliases/>
+ <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>To output help in other formats</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">
+ <usage>list [--xml] [--raw] [--format="..."] [namespace]</usage>
+ <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>
+ <aliases/>
+ <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>To output list in other formats</description>
+ <defaults>
+ <default>txt</default>
+ </defaults>
+ </option>
+ </options>
+ </command>
+ <command id="descriptor:command1" name="descriptor:command1">
+ <usage>descriptor:command1</usage>
+ <description>command 1 description</description>
+ <help>command 1 help</help>
+ <aliases>
+ <alias>alias1</alias>
+ <alias>alias2</alias>
+ </aliases>
+ <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">
+ <usage>descriptor:command2 [-o|--option_name] argument_name</usage>
+ <description>command 2 description</description>
+ <help>command 2 help</help>
+ <aliases/>
+ <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/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt
new file mode 100644
index 0000000..d9734fe
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext1.txt
@@ -0,0 +1,20 @@
+<info>Console Tool</info>
+
+<comment>Usage:</comment>
+ command [options] [arguments]
+
+<comment>Options:</comment>
+ <info>--help</info> (-h) Display this help message
+ <info>--quiet</info> (-q) Do not output any message
+ <info>--verbose</info> (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
+ <info>--version</info> (-V) Display this application version
+ <info>--ansi</info> Force ANSI output
+ <info>--no-ansi</info> Disable ANSI output
+ <info>--no-interaction</info> (-n) Do not ask any interactive question
+
+<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/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt
new file mode 100644
index 0000000..49992cf
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_astext2.txt
@@ -0,0 +1,16 @@
+<info>Console Tool</info>
+
+<comment>Usage:</comment>
+ command [options] [arguments]
+
+<comment>Options:</comment>
+ <info>--help</info> (-h) Display this help message
+ <info>--quiet</info> (-q) Do not output any message
+ <info>--verbose</info> (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
+ <info>--version</info> (-V) Display this application version
+ <info>--ansi</info> Force ANSI output
+ <info>--no-ansi</info> Disable ANSI output
+ <info>--no-interaction</info> (-n) Do not ask any interactive question
+
+<comment>Available commands for the "foo" namespace:</comment>
+ <info>foo:bar </info> The foo:bar command
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt
new file mode 100644
index 0000000..d956781
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml1.txt
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<symfony>
+ <commands>
+ <command id="help" name="help">
+ <usage>help [--xml] [--format="..."] [--raw] [command_name]</usage>
+ <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>
+ <aliases />
+ <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>To output help in other formats</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">
+ <usage>list [--xml] [--raw] [--format="..."] [namespace]</usage>
+ <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>
+ <aliases/>
+ <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>To output list in other formats</description>
+ <defaults>
+ <default>txt</default>
+ </defaults>
+ </option>
+ </options>
+</command>
+ <command id="foo:bar" name="foo:bar">
+ <usage>foo:bar</usage>
+ <description>The foo:bar command</description>
+ <help/>
+ <aliases>
+ <alias>afoobar</alias>
+ </aliases>
+ <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/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_asxml2.txt
new file mode 100644
index 0000000..0b30b20
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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">
+ <usage>foo:bar</usage>
+ <description>The foo:bar command</description>
+ <help/>
+ <aliases>
+ <alias>afoobar</alias>
+ </aliases>
+ <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/Symfony/Component/Console/Tests/Fixtures/application_gethelp.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_gethelp.txt
new file mode 100644
index 0000000..0c16e3c
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt
new file mode 100644
index 0000000..4629345
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception1.txt
@@ -0,0 +1,8 @@
+
+
+
+ [InvalidArgumentException]
+ Command "foo" is not defined.
+
+
+
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt
new file mode 100644
index 0000000..c758129
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception2.txt
@@ -0,0 +1,11 @@
+
+
+
+ [InvalidArgumentException]
+ The "--foo" option does not exist.
+
+
+
+list [--xml] [--raw] [--format="..."] [namespace]
+
+
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception3.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception3.txt
new file mode 100644
index 0000000..72a7286
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception3.txt
@@ -0,0 +1,27 @@
+
+
+
+ [Exception]
+ Third exception comment
+
+
+
+
+
+
+ [Exception]
+ Second exception comment
+
+
+
+
+
+
+ [Exception]
+ First exception <p>this is html</p>
+
+
+
+foo3:bar
+
+
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception3decorated.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception3decorated.txt
new file mode 100644
index 0000000..b44d50b
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception3decorated.txt
@@ -0,0 +1,27 @@
+
+
+ 
+ [Exception] 
+ Third exception comment 
+ 
+
+
+
+
+ 
+ [Exception] 
+ Second exception comment 
+ 
+
+
+
+
+ 
+ [Exception] 
+ First exception <p>this is html</p> 
+ 
+
+
+foo3:bar
+
+
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt
new file mode 100644
index 0000000..19f893b
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception4.txt
@@ -0,0 +1,9 @@
+
+
+
+ [InvalidArgumentException]
+ Command "foo" is not define
+ d.
+
+
+
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth1.txt
new file mode 100644
index 0000000..6a98660
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth1.txt
@@ -0,0 +1,11 @@
+
+
+
+ [Exception]
+ エラーメッセージ
+
+
+
+foo
+
+
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt
new file mode 100644
index 0000000..8c8801b
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt
@@ -0,0 +1,11 @@
+
+
+ 
+ [Exception] 
+ エラーメッセージ 
+ 
+
+
+foo
+
+
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth2.txt
new file mode 100644
index 0000000..545cd7b
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth2.txt
@@ -0,0 +1,12 @@
+
+
+
+ [Exception]
+ コマンドの実行中にエラーが
+ 発生しました。
+
+
+
+foo
+
+
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run1.txt
new file mode 100644
index 0000000..9bd08b5
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run1.txt
@@ -0,0 +1,17 @@
+Console Tool
+
+Usage:
+ command [options] [arguments]
+
+Options:
+ --help (-h) Display this help message
+ --quiet (-q) Do not output any message
+ --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
+ --version (-V) Display this application version
+ --ansi Force ANSI output
+ --no-ansi Disable ANSI output
+ --no-interaction (-n) Do not ask any interactive question
+
+Available commands:
+ help Displays help for a command
+ list Lists commands
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run2.txt
new file mode 100644
index 0000000..6963c0f
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run2.txt
@@ -0,0 +1,29 @@
+Usage:
+ help [--xml] [--format="..."] [--raw] [command_name]
+
+Arguments:
+ command The command to execute
+ command_name The command name (default: "help")
+
+Options:
+ --xml To output help as XML
+ --format To output help in other formats (default: "txt")
+ --raw To output raw command help
+ --help (-h) Display this help message
+ --quiet (-q) Do not output any message
+ --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
+ --version (-V) Display this application version
+ --ansi Force ANSI output
+ --no-ansi Disable ANSI output
+ --no-interaction (-n) Do not ask any interactive question
+
+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/Symfony/Component/Console/Tests/Fixtures/application_run3.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run3.txt
new file mode 100644
index 0000000..0139775
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run3.txt
@@ -0,0 +1,27 @@
+Usage:
+ list [--xml] [--raw] [--format="..."] [namespace]
+
+Arguments:
+ namespace The namespace name
+
+Options:
+ --xml To output list as XML
+ --raw To output raw command list
+ --format To output list in other formats (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/Symfony/Component/Console/Tests/Fixtures/application_run4.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run4.txt
new file mode 100644
index 0000000..47187fc
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/application_run4.txt
@@ -0,0 +1 @@
+Console Tool
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.json
new file mode 100644
index 0000000..0c1675d
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.json
@@ -0,0 +1 @@
+{"name":"descriptor:command1","usage":"descriptor:command1","description":"command 1 description","help":"command 1 help","aliases":["alias1","alias2"],"definition":{"arguments":[],"options":[]}}
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.md
new file mode 100644
index 0000000..2cef9a2
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.md
@@ -0,0 +1,8 @@
+descriptor:command1
+-------------------
+
+* Description: command 1 description
+* Usage: `descriptor:command1`
+* Aliases: `alias1`, `alias2`
+
+command 1 help
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.txt
new file mode 100644
index 0000000..2375ac0
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.txt
@@ -0,0 +1,7 @@
+<comment>Usage:</comment>
+ descriptor:command1
+
+<comment>Aliases:</comment> <info>alias1, alias2</info>
+
+<comment>Help:</comment>
+ command 1 help
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.xml
new file mode 100644
index 0000000..dcfa6fa
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_1.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<command id="descriptor:command1" name="descriptor:command1">
+ <usage>descriptor:command1</usage>
+ <description>command 1 description</description>
+ <help>command 1 help</help>
+ <aliases>
+ <alias>alias1</alias>
+ <alias>alias2</alias>
+ </aliases>
+ <arguments/>
+ <options/>
+</command>
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_2.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_2.json
new file mode 100644
index 0000000..493b584
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_2.json
@@ -0,0 +1 @@
+{"name":"descriptor:command2","usage":"descriptor:command2 [-o|--option_name] argument_name","description":"command 2 description","help":"command 2 help","aliases":[],"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/Symfony/Component/Console/Tests/Fixtures/command_2.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_2.md
new file mode 100644
index 0000000..5257c0d
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_2.md
@@ -0,0 +1,30 @@
+descriptor:command2
+-------------------
+
+* Description: command 2 description
+* Usage: `descriptor:command2 [-o|--option_name] argument_name`
+* Aliases: <none>
+
+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/Symfony/Component/Console/Tests/Fixtures/command_2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_2.txt
new file mode 100644
index 0000000..1da9f3d
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_2.txt
@@ -0,0 +1,11 @@
+<comment>Usage:</comment>
+ descriptor:command2 [-o|--option_name] argument_name
+
+<comment>Arguments:</comment>
+ <info>argument_name </info>
+
+<comment>Options:</comment>
+ <info>--option_name</info> (-o)
+
+<comment>Help:</comment>
+ command 2 help
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_2.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_2.xml
new file mode 100644
index 0000000..c411c36
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_2.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<command id="descriptor:command2" name="descriptor:command2">
+ <usage>descriptor:command2 [-o|--option_name] argument_name</usage>
+ <description>command 2 description</description>
+ <help>command 2 help</help>
+ <aliases/>
+ <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/Symfony/Component/Console/Tests/Fixtures/command_astext.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_astext.txt
new file mode 100644
index 0000000..5d70351
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_astext.txt
@@ -0,0 +1,18 @@
+<comment>Usage:</comment>
+ namespace:name
+
+<comment>Aliases:</comment> <info>name</info>
+<comment>Arguments:</comment>
+ <info>command </info> The command to execute
+
+<comment>Options:</comment>
+ <info>--help</info> (-h) Display this help message
+ <info>--quiet</info> (-q) Do not output any message
+ <info>--verbose</info> (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
+ <info>--version</info> (-V) Display this application version
+ <info>--ansi</info> Force ANSI output
+ <info>--no-ansi</info> Disable ANSI output
+ <info>--no-interaction</info> (-n) Do not ask any interactive question
+
+<comment>Help:</comment>
+ help
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt
new file mode 100644
index 0000000..57542fa
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/command_asxml.txt
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<command id="namespace:name" name="namespace:name">
+ <usage>namespace:name</usage>
+ <description>description</description>
+ <help>help</help>
+ <aliases>
+ <alias>name</alias>
+ </aliases>
+ <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/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/definition_astext.txt
new file mode 100644
index 0000000..a7d7e0d
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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>--foo</info> (-f) The foo option
+ <info>--baz</info> The baz option<comment> (default: false)</comment>
+ <info>--bar</info> (-b) The bar option<comment> (default: "bar")</comment>
+ <info>--qux</info> The qux option<comment> (default: ["http://foo.com/","bar"])</comment><comment> (multiple values allowed)</comment>
+ <info>--qux2</info> The qux2 option<comment> (default: {"foo":"bar"})</comment><comment> (multiple values allowed)</comment>
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/definition_asxml.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/definition_asxml.txt
new file mode 100644
index 0000000..eec8c07
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_argument_1.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_1.json
new file mode 100644
index 0000000..b8173b6
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_argument_1.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_1.md
new file mode 100644
index 0000000..88f311a
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_argument_1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_1.txt
new file mode 100644
index 0000000..111e515
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_1.txt
@@ -0,0 +1 @@
+ <info>argument_name</info>
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_1.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_1.xml
new file mode 100644
index 0000000..cb37f81
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_argument_2.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_2.json
new file mode 100644
index 0000000..ef06b09
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_argument_2.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_2.md
new file mode 100644
index 0000000..3cdb00c
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_argument_2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_2.txt
new file mode 100644
index 0000000..9497b1c
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_2.txt
@@ -0,0 +1 @@
+ <info>argument_name</info> argument description
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_2.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_2.xml
new file mode 100644
index 0000000..629da5a
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_argument_3.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_3.json
new file mode 100644
index 0000000..de8484e
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_argument_3.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_3.md
new file mode 100644
index 0000000..be1c443
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_argument_3.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_3.txt
new file mode 100644
index 0000000..c421fc9
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_argument_3.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_argument_3.xml
new file mode 100644
index 0000000..399a5c8
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_definition_1.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_1.json
new file mode 100644
index 0000000..c7a7d83
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_1.json
@@ -0,0 +1 @@
+{"arguments":[],"options":[]}
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_1.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_1.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_1.md
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_1.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_1.txt
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_1.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_1.xml
new file mode 100644
index 0000000..b5481ce
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_definition_2.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_2.json
new file mode 100644
index 0000000..9964a55
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_definition_2.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_2.md
new file mode 100644
index 0000000..923191c
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_definition_2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_2.txt
new file mode 100644
index 0000000..0db9f66
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_2.txt
@@ -0,0 +1,2 @@
+<comment>Arguments:</comment>
+ <info>argument_name </info>
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_2.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_2.xml
new file mode 100644
index 0000000..102efc1
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_definition_3.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_3.json
new file mode 100644
index 0000000..6a86056
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_definition_3.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_3.md
new file mode 100644
index 0000000..40fd7b0
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_definition_3.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_3.txt
new file mode 100644
index 0000000..c6fb2cc
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_3.txt
@@ -0,0 +1,2 @@
+<comment>Options:</comment>
+ <info>--option_name</info> (-o)
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_3.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_3.xml
new file mode 100644
index 0000000..bc95151
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_definition_4.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_4.json
new file mode 100644
index 0000000..c5a0019
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_definition_4.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_4.md
new file mode 100644
index 0000000..a31feea
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_definition_4.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_4.txt
new file mode 100644
index 0000000..e17c61c
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_4.txt
@@ -0,0 +1,5 @@
+<comment>Arguments:</comment>
+ <info>argument_name </info>
+
+<comment>Options:</comment>
+ <info>--option_name</info> (-o)
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_4.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_definition_4.xml
new file mode 100644
index 0000000..cffceec
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_option_1.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_1.json
new file mode 100644
index 0000000..60c5b56
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_option_1.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_1.md
new file mode 100644
index 0000000..6f9e9a7
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_option_1.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_1.txt
new file mode 100644
index 0000000..daf83d0
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_1.txt
@@ -0,0 +1 @@
+ <info>--option_name</info> (-o)
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_1.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_1.xml
new file mode 100644
index 0000000..8a64ea6
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_option_2.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_2.json
new file mode 100644
index 0000000..04e4228
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_option_2.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_2.md
new file mode 100644
index 0000000..634ac0b
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_option_2.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_2.txt
new file mode 100644
index 0000000..627e3c1
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_2.txt
@@ -0,0 +1 @@
+ <info>--option_name</info> (-o) option description<comment> (default: "default_value")</comment>
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_2.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_2.xml
new file mode 100644
index 0000000..4afac5b
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_option_3.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_3.json
new file mode 100644
index 0000000..c1ea120
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_option_3.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_3.md
new file mode 100644
index 0000000..3428289
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_option_3.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_3.txt
new file mode 100644
index 0000000..b88b12d
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_3.txt
@@ -0,0 +1 @@
+ <info>--option_name</info> (-o) option description
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_3.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_3.xml
new file mode 100644
index 0000000..dcc0631
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_option_4.json b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_4.json
new file mode 100644
index 0000000..1b671d8
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_option_4.md b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_4.md
new file mode 100644
index 0000000..8ffba56
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Fixtures/input_option_4.txt b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_4.txt
new file mode 100644
index 0000000..5dba5e6
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_4.txt
@@ -0,0 +1 @@
+ <info>--option_name</info> (-o) option description<comment> (multiple values allowed)</comment>
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_4.xml b/vendor/symfony/console/Symfony/Component/Console/Tests/Fixtures/input_option_4.xml
new file mode 100644
index 0000000..5e2418b
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleStackTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleStackTest.php
new file mode 100644
index 0000000..774df26
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php
new file mode 100644
index 0000000..52ada9e
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterStyleTest.php
@@ -0,0 +1,93 @@
+<?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'));
+
+ $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'));
+
+ $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/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php
new file mode 100644
index 0000000..4f4fbbe
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php
@@ -0,0 +1,257 @@
+<?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 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
+ ));
+ }
+}
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php
new file mode 100644
index 0000000..e332774
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.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\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()
+ {
+ if (!function_exists('mb_detect_encoding')) {
+ $this->markTestSkipped('This test requires mbstring to work.');
+ }
+
+ $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()
+ {
+ if (!extension_loaded('mbstring')) {
+ $this->markTestSkipped('This test requires mbstring to work.');
+ }
+ $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/Symfony/Component/Console/Tests/Helper/HelperSetTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/HelperSetTest.php
new file mode 100644
index 0000000..bf58a45
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/HelperSetTest.php
@@ -0,0 +1,153 @@
+<?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
+{
+ /**
+ * @covers \Symfony\Component\Console\Helper\HelperSet::__construct
+ */
+ 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');
+ }
+
+ /**
+ * @covers \Symfony\Component\Console\Helper\HelperSet::set
+ */
+ 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');
+ }
+
+ /**
+ * @covers \Symfony\Component\Console\Helper\HelperSet::has
+ */
+ 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');
+ }
+
+ /**
+ * @covers \Symfony\Component\Console\Helper\HelperSet::get
+ */
+ 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->assertContains('The helper "foo" is not defined.', $e->getMessage(), '->get() throws \InvalidArgumentException when helper not found');
+ }
+ }
+
+ /**
+ * @covers \Symfony\Component\Console\Helper\HelperSet::setCommand
+ */
+ 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');
+ }
+
+ /**
+ * @covers \Symfony\Component\Console\Helper\HelperSet::getCommand
+ */
+ public function testGetCommand()
+ {
+ $cmd = new Command('foo');
+ $helperset = new HelperSet();
+ $helperset->setCommand($cmd);
+ $this->assertEquals($cmd, $helperset->getCommand(), '->getCommand() retrieves stored command');
+ }
+
+ /**
+ * @covers \Symfony\Component\Console\Helper\HelperSet::getIterator
+ */
+ 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/Symfony/Component/Console/Tests/Helper/LegacyDialogHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/LegacyDialogHelperTest.php
new file mode 100644
index 0000000..cf07793
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/LegacyDialogHelperTest.php
@@ -0,0 +1,200 @@
+<?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\StreamOutput;
+
+/**
+ * @group legacy
+ */
+class LegacyDialogHelperTest extends \PHPUnit_Framework_TestCase
+{
+ protected function setUp()
+ {
+ $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
+ }
+
+ 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 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 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?'));
+ }
+
+ 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($this->getOutputStream(), $question, $validator, 2, 'white'));
+ $this->fail();
+ } catch (\InvalidArgumentException $e) {
+ $this->assertEquals($error, $e->getMessage());
+ }
+ }
+
+ 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));
+ }
+
+ private function hasSttyAvailable()
+ {
+ exec('stty 2>&1', $output, $exitcode);
+
+ return $exitcode === 0;
+ }
+}
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/LegacyProgressHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/LegacyProgressHelperTest.php
new file mode 100644
index 0000000..e93057a
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/LegacyProgressHelperTest.php
@@ -0,0 +1,232 @@
+<?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
+ */
+class LegacyProgressHelperTest extends \PHPUnit_Framework_TestCase
+{
+ protected function setUp()
+ {
+ $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
+ }
+
+ 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()
+ {
+ if (!function_exists('mb_strlen') || (false === $encoding = mb_detect_encoding('■'))) {
+ $this->markTestSkipped('The mbstring extension is needed for multi-byte support');
+ }
+
+ $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/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php
new file mode 100644
index 0000000..b7e3159
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php
@@ -0,0 +1,325 @@
+<?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->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
+ $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()
+ {
+ if (!function_exists('mb_strwidth')) {
+ $this->markTestSkipped('The "mbstring" extension is not available');
+ }
+
+ $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()
+ {
+ if (!function_exists('mb_strwidth')) {
+ $this->markTestSkipped('The "mbstring" extension is not available');
+ }
+
+ $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/Symfony/Component/Console/Tests/Helper/ProcessHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProcessHelperTest.php
new file mode 100644
index 0000000..2e333dc
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProcessHelperTest.php
@@ -0,0 +1,118 @@
+<?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\Helper\Helper;
+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(50000);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(50000);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(50000);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/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php
new file mode 100644
index 0000000..59c06bb
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php
@@ -0,0 +1,598 @@
+<?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;
+
+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 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($output = $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 testMultiByteSupport()
+ {
+ if (!function_exists('mb_strlen') || (false === $encoding = mb_detect_encoding('■'))) {
+ $this->markTestSkipped('The mbstring extension is needed for multi-byte support');
+ }
+
+ $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%\n".
+ " 20/200 [==>-------------------------] 10%\n".
+ " 40/200 [=====>----------------------] 20%\n".
+ " 60/200 [========>-------------------] 30%\n".
+ " 80/200 [===========>----------------] 40%\n".
+ " 100/200 [==============>-------------] 50%\n".
+ " 120/200 [================>-----------] 60%\n".
+ " 140/200 [===================>--------] 70%\n".
+ " 160/200 [======================>-----] 80%\n".
+ " 180/200 [=========================>--] 90%\n".
+ " 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%\n".
+ " 25/50 [==============>-------------] 50%\n".
+ " 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 [>---------------------------]\n".
+ " 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 ").
+ $this->generateOutput(" \n ").
+ $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".($count ? sprintf("\033[%dA", $count) : '').$expected;
+ }
+}
diff --git a/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php
new file mode 100644
index 0000000..0ab0849
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php
@@ -0,0 +1,238 @@
+<?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\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');
+ // 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);
+ $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!');
+ $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->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->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->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 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));
+ }
+
+ public function testAskConfirmation()
+ {
+ $dialog = new QuestionHelper();
+
+ $dialog->setInputStream($this->getInputStream("\n\n"));
+ $question = new ConfirmationQuestion('Do you like French fries?');
+ $this->assertTrue($dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $question = new ConfirmationQuestion('Do you like French fries?', false);
+ $this->assertFalse($dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+
+ $dialog->setInputStream($this->getInputStream("y\nyes\n"));
+ $question = new ConfirmationQuestion('Do you like French fries?', false);
+ $this->assertTrue($dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $question = new ConfirmationQuestion('Do you like French fries?', false);
+ $this->assertTrue($dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+
+ $dialog->setInputStream($this->getInputStream("n\nno\n"));
+ $question = new ConfirmationQuestion('Do you like French fries?', true);
+ $this->assertFalse($dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $question = new ConfirmationQuestion('Do you like French fries?', true);
+ $this->assertFalse($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 {
+ $this->assertEquals('white', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
+ $this->fail();
+ } catch (\InvalidArgumentException $e) {
+ $this->assertEquals($error, $e->getMessage());
+ }
+ }
+
+ 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));
+ }
+
+ 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/Symfony/Component/Console/Tests/Helper/TableTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/TableTest.php
new file mode 100644
index 0000000..18a2ab6
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Helper/TableTest.php
@@ -0,0 +1,357 @@
+<?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\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
+ ),
+ );
+ }
+
+ public function testRenderMultiByte()
+ {
+ if (!function_exists('mb_strlen')) {
+ $this->markTestSkipped('The "mbstring" extension is not available');
+ }
+
+ $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));
+ }
+
+ 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/Symfony/Component/Console/Tests/Input/ArgvInputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/ArgvInputTest.php
new file mode 100644
index 0000000..d2c540e
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Input/ArrayInputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/ArrayInputTest.php
new file mode 100644
index 0000000..cc89083
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Input/InputArgumentTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputArgumentTest.php
new file mode 100644
index 0000000..cfb37cd
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php
new file mode 100644
index 0000000..ce0654d
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php
@@ -0,0 +1,430 @@
+<?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');
+ }
+
+ public function testGetSynopsis()
+ {
+ $definition = new InputDefinition(array(new InputOption('foo')));
+ $this->assertEquals('[--foo]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+ $definition = new InputDefinition(array(new InputOption('foo', 'f')));
+ $this->assertEquals('[-f|--foo]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+ $definition = new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)));
+ $this->assertEquals('[-f|--foo="..."]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+ $definition = new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)));
+ $this->assertEquals('[-f|--foo[="..."]]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+
+ $definition = new InputDefinition(array(new InputArgument('foo')));
+ $this->assertEquals('[foo]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+ $definition = new InputDefinition(array(new InputArgument('foo', InputArgument::REQUIRED)));
+ $this->assertEquals('foo', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+ $definition = new InputDefinition(array(new InputArgument('foo', InputArgument::IS_ARRAY)));
+ $this->assertEquals('[foo1] ... [fooN]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+ $definition = new InputDefinition(array(new InputArgument('foo', InputArgument::REQUIRED | InputArgument::IS_ARRAY)));
+ $this->assertEquals('foo1 ... [fooN]', $definition->getSynopsis(), '->getSynopsis() returns a synopsis of arguments and options');
+ }
+
+ /**
+ * @group legacy
+ */
+ public function testLegacyAsText()
+ {
+ $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
+
+ $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()
+ {
+ $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
+
+ $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/Symfony/Component/Console/Tests/Input/InputOptionTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputOptionTest.php
new file mode 100644
index 0000000..53ce1df
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Input/InputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputTest.php
new file mode 100644
index 0000000..0b3e38f
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/InputTest.php
@@ -0,0 +1,121 @@
+<?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.
+ */
+ public function testValidateWithMissingArguments()
+ {
+ $input = new ArrayInput(array());
+ $input->bind(new InputDefinition(array(new InputArgument('name', InputArgument::REQUIRED))));
+ $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/Symfony/Component/Console/Tests/Input/StringInputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/StringInputTest.php
new file mode 100644
index 0000000..575d527
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Input/StringInputTest.php
@@ -0,0 +1,101 @@
+<?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()
+ {
+ $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
+
+ $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/Symfony/Component/Console/Tests/Logger/ConsoleLoggerTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Logger/ConsoleLoggerTest.php
new file mode 100644
index 0000000..1abc363
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Output/ConsoleOutputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Output/ConsoleOutputTest.php
new file mode 100644
index 0000000..1afbbb6
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Output/NullOutputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Output/NullOutputTest.php
new file mode 100644
index 0000000..b20ae4e
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Output/OutputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Output/OutputTest.php
new file mode 100644
index 0000000..cfb4afe
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/Console/Tests/Output/OutputTest.php
@@ -0,0 +1,156 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Console\Tests\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');
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @expectedExceptionMessage Unknown output type given (24)
+ */
+ public function testWriteWithInvalidOutputType()
+ {
+ $output = new TestOutput();
+ $output->writeln('<foo>foo</foo>', 24);
+ }
+
+ 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');
+ }
+}
+
+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/Symfony/Component/Console/Tests/Output/StreamOutputTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Output/StreamOutputTest.php
new file mode 100644
index 0000000..2fd4f61
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Tester/ApplicationTesterTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Tester/ApplicationTesterTest.php
new file mode 100644
index 0000000..a8389dd
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php b/vendor/symfony/console/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php
new file mode 100644
index 0000000..b54c00e
--- /dev/null
+++ b/vendor/symfony/console/Symfony/Component/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()));
+ }
+}