Skip to content

Commit 35facc6

Browse files
committed
[Console] Caution about disabling auto exist flag
1 parent f66d64d commit 35facc6

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
@@ -387,6 +387,16 @@ console::
387387
not dispatched. If you need to test those events, use the
388388
:class:`Symfony\\Component\\Console\\Tester\\ApplicationTester` instead.
389389

390+
.. caution::
391+
392+
When testing commands using the ``ApplicationTester`` class, don't forget to disable the auto exist flag :
393+
394+
$application = new Application();
395+
396+
$application->setAutoExit(false);
397+
398+
$applicationTester = new ApplicationTester($application);
399+
390400
.. note::
391401

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

0 commit comments

Comments
 (0)