Skip to content

Commit

Permalink
Modify column size handling in ErrorSuite and tests
Browse files Browse the repository at this point in the history
Adjusted the column size handling in ErrorSuite.php to use 'COLUMNS_TEST' instead of 'COLUMNS' for improved testing flexibility. Also applied changes to Makefile and phpunit.xml.dist files to align with the modification made in ErrorSuite.
  • Loading branch information
Denis Smet committed Mar 13, 2024
1 parent aaf53ad commit 42a5778
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

.PHONY: build

REPORT ?= table
COLUMNS ?= 150
REPORT ?= table
COLUMNS_TEST ?= 150

ifneq (, $(wildcard ./vendor/jbzoo/codestyle/src/init.Makefile))
include ./vendor/jbzoo/codestyle/src/init.Makefile
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
</logging>

<php>
<env name="COLUMNS" value="150"/>
<env name="COLUMNS_TEST" value="150"/>
</php>
</phpunit>
3 changes: 2 additions & 1 deletion src/Validators/ErrorSuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ private static function getTableSize(): array
];

// Fallback to 80 if the terminal width cannot be determined.
$maxAutoDetected = Env::int('COLUMNS', Cli::getNumberOfColumns());
// env.COLUMNS_TEST usually not defined so we use it only for testing purposes.
$maxAutoDetected = Env::int('COLUMNS_TEST', Cli::getNumberOfColumns());

$maxWindowWidth = Vars::limit(
$maxAutoDetected,
Expand Down

0 comments on commit 42a5778

Please sign in to comment.