Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add note about not passing the command argument with Symfony 2.4 #3087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cookbook/console/console_command.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ instead of
$commandTester = new CommandTester($command);
$commandTester->execute(
array(
'command' => $command->getName(),
'name' => 'Fabien',
'--yell' => true,
)
Expand All @@ -171,6 +170,11 @@ instead of
}
}

.. versionadded:: 2.4
Since Symfony 2.4, the ``CommandTester`` automatically detects the name of
the command to execute. Thus, you don't need to pass it via the ``command``
argument anymore.

.. note::

In the specific case above, the ``name`` parameter and the ``--yell`` option
Expand Down Expand Up @@ -200,7 +204,6 @@ you can extend your test from
$commandTester = new CommandTester($command);
$commandTester->execute(
array(
'command' => $command->getName(),
'name' => 'Fabien',
'--yell' => true,
)
Expand Down