Skip to content

Commit b28603e

Browse files
ybenhssaienxabbuh
authored andcommitted
[Console] Caution about disabling auto exit flag
1 parent 1ff60fd commit b28603e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

console.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,16 @@ console::
393393
not dispatched. If you need to test those events, use the
394394
:class:`Symfony\\Component\\Console\\Tester\\ApplicationTester` instead.
395395

396+
.. caution::
397+
398+
When testing commands using the :class:`Symfony\\Component\\Console\\Tester\\ApplicationTester`
399+
class, don't forget to disable the auto exit flag::
400+
401+
$application = new Application();
402+
$application->setAutoExit(false);
403+
404+
$tester = new ApplicationTester($application);
405+
396406
.. note::
397407

398408
When using the Console component in a standalone project, use

0 commit comments

Comments
 (0)