Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / symfony / console / Symfony / Component / Console / Tests / Command / ListCommandTest.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Console\Tests\Command;
13
14 use Symfony\Component\Console\Tester\CommandTester;
15 use Symfony\Component\Console\Application;
16
17 class ListCommandTest extends \PHPUnit_Framework_TestCase
18 {
19     public function testExecute()
20     {
21         $application = new Application();
22
23         $commandTester = new CommandTester($command = $application->get('list'));
24         $commandTester->execute(array('command' => $command->getName()), array('decorated' => false));
25         $this->assertRegExp('/help   Displays help for a command/', $commandTester->getDisplay(), '->execute() returns a list of available commands');
26
27         $commandTester->execute(array('command' => $command->getName(), '--xml' => true));
28         $this->assertRegExp('/<command id="list" name="list">/', $commandTester->getDisplay(), '->execute() returns a list of available commands in XML if --xml is passed');
29
30         $commandTester->execute(array('command' => $command->getName(), '--raw' => true));
31         $output = <<<EOF
32 help   Displays help for a command
33 list   Lists commands
34
35 EOF;
36         $this->assertEquals(str_replace("\n", PHP_EOL, $output), $commandTester->getDisplay(), 'boo');
37     }
38 }