File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -582,6 +582,24 @@ call ``setAutoExit(false)`` on it to get the command result in ``CommandTester``
582
582
:class: `Symfony\\ Component\\ Console\\ Application `
583
583
and extend the normal ``\PHPUnit\Framework\TestCase ``.
584
584
585
+ When testing your commands, it could be useful to understand how your command
586
+ reacts on different settings like the width and the height of the terminal.
587
+ Thanks to the :class: `Symfony\\ Component\\ Console\\ Terminal ` class, you can
588
+ have access to such information::
589
+
590
+ use Symfony\Component\Console\Terminal;
591
+
592
+ $terminal = new Terminal();
593
+
594
+ // access to number of lines available
595
+ $height = $terminal->getHeight();
596
+
597
+ // access to number of columns available
598
+ $width = $terminal->getWidth();
599
+
600
+ By default, the ``Terminal `` class uses the values of the
601
+ ``LINES `` and ``COLUMNS `` system environment variables.
602
+
585
603
Logging Command Errors
586
604
----------------------
587
605
You can’t perform that action at this time.
0 commit comments