This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/unit/Symfony/Components/CLI/Command/ListCommandTest.php
2010-01-04 19:51:21 +01:00

29 lines
955 B
PHP

<?php
/*
* This file is part of the symfony package.
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require_once __DIR__.'/../../../../bootstrap.php';
use Symfony\Components\CLI\Tester\CommandTester;
use Symfony\Components\CLI\Application;
$t = new LimeTest(2);
$application = new Application();
// ->execute()
$t->diag('->execute()');
$commandTester = new CommandTester($application->getCommand('list'));
$commandTester->execute(array());
$t->like($commandTester->getDisplay(), '/help Displays help for a command/', '->execute() returns a list of available commands');
$commandTester->execute(array('--xml' => true));
$t->like($commandTester->getDisplay(), '/<command id="list" namespace="_global" name="list">/', '->execute() returns a list of available commands in XML if --xml is passed');