12 namespace Symfony\Component\Console\Tests\Command;
22 $commandTester =
new CommandTester($command = $application->get(
'list'));
23 $commandTester->
execute(array(
'command' => $command->getName()), array(
'decorated' =>
false));
25 $this->assertRegExp(
'/help\s{2,}Displays help for a command/', $commandTester->getDisplay(),
'->execute() returns a list of available commands');
31 $commandTester =
new CommandTester($command = $application->get(
'list'));
32 $commandTester->
execute(array(
'command' => $command->getName(),
'--format' =>
'xml'));
33 $this->assertRegExp(
'/<command id="list" name="list">/', $commandTester->getDisplay(),
'->execute() returns a list of available commands in XML if --xml is passed');
39 $commandTester =
new CommandTester($command = $application->get(
'list'));
40 $commandTester->
execute(array(
'command' => $command->getName(),
'--raw' =>
true));
42 help Displays help
for a command
47 $this->assertEquals($output, $commandTester->getDisplay(
true));
52 require_once realpath(__DIR__.
'/../Fixtures/FooCommand.php');
55 $commandTester =
new CommandTester($command = $application->get(
'list'));
56 $commandTester->
execute(array(
'command' => $command->getName(),
'namespace' =>
'foo',
'--raw' =>
true));
58 foo:bar The foo:bar command
62 $this->assertEquals($output, $commandTester->getDisplay(
true));