From b28603e9d9c8fd4ca1179c5b1b450980545e7fea Mon Sep 17 00:00:00 2001 From: Youssef BENHSSAIEN Date: Sat, 19 Dec 2020 11:02:14 +0100 Subject: [PATCH] [Console] Caution about disabling auto exit flag --- console.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/console.rst b/console.rst index 9611ce94bfd..e980cea046a 100644 --- a/console.rst +++ b/console.rst @@ -393,6 +393,16 @@ console:: not dispatched. If you need to test those events, use the :class:`Symfony\\Component\\Console\\Tester\\ApplicationTester` instead. +.. caution:: + + When testing commands using the :class:`Symfony\\Component\\Console\\Tester\\ApplicationTester` + class, don't forget to disable the auto exit flag:: + + $application = new Application(); + $application->setAutoExit(false); + + $tester = new ApplicationTester($application); + .. note:: When using the Console component in a standalone project, use