From f1a3b50e01826e7ece8164559dc8bdbd56b36731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Quatannens?= Date: Wed, 3 Jul 2013 10:21:12 +0200 Subject: [PATCH] Cookbook/Console/ConsoleCommand : Adding option/argument example in test --- cookbook/console/console_command.rst | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cookbook/console/console_command.rst b/cookbook/console/console_command.rst index 41aba0f58ff..26b8a5e6164 100644 --- a/cookbook/console/console_command.rst +++ b/cookbook/console/console_command.rst @@ -102,7 +102,13 @@ should be used instead of :class:`Symfony\\Component\\Console\\Application`:: $command = $application->find('demo:greet'); $commandTester = new CommandTester($command); - $commandTester->execute(array('command' => $command->getName())); + $commandTester->execute( + array( + 'command' => $command->getName(), + 'name' => 'Fabien', + '--yell' => true, + ) + ); $this->assertRegExp('/.../', $commandTester->getDisplay()); @@ -131,7 +137,13 @@ you can extend your test from $command = $application->find('demo:greet'); $commandTester = new CommandTester($command); - $commandTester->execute(array('command' => $command->getName())); + $commandTester->execute( + array( + 'command' => $command->getName(), + 'name' => 'Fabien', + '--yell' => true, + ) + ); $this->assertRegExp('/.../', $commandTester->getDisplay());