Skip to content

Commit 5287a2e

Browse files
committed
feature #15479 [Console] Document CommandTester::assertCommandIsSuccessful() usage (yoannrenard)
This PR was merged into the 5.4 branch. Discussion ---------- [Console] Document CommandTester::assertCommandIsSuccessful() usage This PR documents how to use the new CommandTester::assertCommandIsSuccessful() method. Commits ------- aad93f4 [Console] Document CommandTester::assertCommandIsSuccessful() usage
2 parents cdb16f9 + aad93f4 commit 5287a2e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

console.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ console::
384384
// e.g: '--some-option' => 'option_value',
385385
]);
386386

387+
$commandTester->assertCommandIsSuccessful();
388+
387389
// the output of the command in the console
388390
$output = $commandTester->getDisplay();
389391
$this->assertStringContainsString('Username: Wouter', $output);
@@ -400,6 +402,10 @@ call ``setAutoExit(false)`` on it to get the command result in ``CommandTester``
400402
The ``setAutoExit()`` method for single-command applications was introduced
401403
in Symfony 5.2.
402404

405+
.. versionadded:: 5.4
406+
407+
The ``assertCommandIsSuccessful()`` method was introduced in Symfony 5.4.
408+
403409
.. tip::
404410

405411
You can also test a whole console application by using

0 commit comments

Comments
 (0)