Console tests fail on a narrow terminal #6988

Open
opened 2026-01-22 15:42:41 +01:00 by admin · 1 comment
Owner

Originally created by @morozov on GitHub (Jun 3, 2022).

Bug Report

Q A
BC Break no
Version 2.13.x

How to reproduce

$ COLUMNS=80 phpunit tests/Doctrine/Tests/ORM/Tools/Console/Command

PHPUnit 9.5.20 #StandWithUkraine

Using DB driver Doctrine\DBAL\Logging\Driver
.FFF.FFF...F.......F.F.........                                                                                                                             31 / 31 (100%)

Time: 00:00.236, Memory: 26.00 MB

There were 9 failures:

1) Doctrine\Tests\ORM\Tools\Console\Command\ClearCacheCollectionRegionCommandTest::testClearByOwnerEntityClassName
Failed asserting that '\n
 // Clearing second-level cache for collection                                  \n
 // "Doctrine\Tests\Models\Cache\State#cities"                                  \n
\n
' contains " // Clearing second-level cache for collection "Doctrine\Tests\Models\Cache\State#cities"".

tests/Doctrine/Tests/ORM/Tools/Console/Command/ClearCacheCollectionRegionCommandTest.php:68
...

Note that the expected string is present in the output but it contains a line break in between since it doesn't fit in the terminal width.

Originally created by @morozov on GitHub (Jun 3, 2022). ### Bug Report <!-- Fill in the relevant information below to help triage your issue. --> | Q | A |------------ | ------ | BC Break | no | Version | 2.13.x #### How to reproduce ``` $ COLUMNS=80 phpunit tests/Doctrine/Tests/ORM/Tools/Console/Command PHPUnit 9.5.20 #StandWithUkraine Using DB driver Doctrine\DBAL\Logging\Driver .FFF.FFF...F.......F.F......... 31 / 31 (100%) Time: 00:00.236, Memory: 26.00 MB There were 9 failures: 1) Doctrine\Tests\ORM\Tools\Console\Command\ClearCacheCollectionRegionCommandTest::testClearByOwnerEntityClassName Failed asserting that '\n // Clearing second-level cache for collection \n // "Doctrine\Tests\Models\Cache\State#cities" \n \n ' contains " // Clearing second-level cache for collection "Doctrine\Tests\Models\Cache\State#cities"". tests/Doctrine/Tests/ORM/Tools/Console/Command/ClearCacheCollectionRegionCommandTest.php:68 ... ``` Note that the expected string is present in the output but it contains a line break in between since it doesn't fit in the terminal width.
Author
Owner

@greg0ire commented on GitHub (Jun 3, 2022):

A solution might be to do this: 123b1651c4/src/Symfony/Component/Console/Tests/TerminalTest.php

@greg0ire commented on GitHub (Jun 3, 2022): A solution might be to do this: https://github.com/symfony/symfony/blob/123b1651c4a7e219ba59074441badfac65525efe/src/Symfony/Component/Console/Tests/TerminalTest.php
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6988