Skip to content

Commit f3e9d17

Browse files
committed
Merge pull request #3087 from xabbuh/issue-2870-master
add note about not passing the command argument with Symfony 2.4
2 parents e874269 + b02bc8c commit f3e9d17

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cookbook/console/console_command.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ instead of
159159
$commandTester = new CommandTester($command);
160160
$commandTester->execute(
161161
array(
162-
'command' => $command->getName(),
163162
'name' => 'Fabien',
164163
'--yell' => true,
165164
)
@@ -171,6 +170,11 @@ instead of
171170
}
172171
}
173172

173+
.. versionadded:: 2.4
174+
Since Symfony 2.4, the ``CommandTester`` automatically detects the name of
175+
the command to execute. Thus, you don't need to pass it via the ``command``
176+
argument anymore.
177+
174178
.. note::
175179

176180
In the specific case above, the ``name`` parameter and the ``--yell`` option
@@ -200,7 +204,6 @@ you can extend your test from
200204
$commandTester = new CommandTester($command);
201205
$commandTester->execute(
202206
array(
203-
'command' => $command->getName(),
204207
'name' => 'Fabien',
205208
'--yell' => true,
206209
)

0 commit comments

Comments
 (0)