Skip to content

Conversation

@ttskch
Copy link
Contributor

@ttskch ttskch commented Oct 14, 2025

Q A
Branch? 7.3
Bug fix? yes
New feature? no
Deprecations? no
Issues Related to #61033
License MIT

There was a bug where if only $_SERVER['SHELL_VERBOSITY'] or $_ENV['SHELL_VERBOSITY'] had a value, they would be erroneously unset after command execution.

For example, in PHPUnit's default configuration, SHELL_VERBOSITY is set only to $_SERVER['SHELL_VERBOSITY'].

This caused the SHELL_VERBOSITY setting to be invalid after a console command was executed internally using the ResetDatabase trait of zenstruck/foundry.

@ttskch ttskch requested a review from chalasr as a code owner October 14, 2025 04:09
@carsonbot carsonbot added this to the 7.3 milestone Oct 14, 2025
@ttskch ttskch changed the title [Console] fix: Ensure SHELL_VERBOSITY is always restored properly [Console] Ensure SHELL_VERBOSITY is always restored properly Oct 14, 2025
@ttskch ttskch force-pushed the fix/console-shell-verbosity branch 2 times, most recently from 39d8a5c to cb18974 Compare October 14, 2025 04:29
@nicolas-grekas nicolas-grekas force-pushed the fix/console-shell-verbosity branch from cb18974 to 8da524e Compare October 14, 2025 15:47
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented the 3 separate resets and did some code simplifications while at it.

@nicolas-grekas
Copy link
Member

Thank you @ttskch.

@nicolas-grekas nicolas-grekas merged commit a63f93a into symfony:7.3 Oct 14, 2025
10 of 11 checks passed
@ttskch ttskch deleted the fix/console-shell-verbosity branch October 14, 2025 16:56
@fabpot fabpot mentioned this pull request Oct 28, 2025
@misaert
Copy link
Contributor

misaert commented Nov 13, 2025

Hi @ttskch,

Just for information, I had an issue with PestPHP because I didn't have any output anymore when I launched my tests.

It is because with the default configuration of PHPUnit as you mentioned, the SHELL_VERBOSITY is defined to -1. But before this PR, the default value (0 corresponding to normal verbosity) was taken into account.

Now, I need to remove the server superglobal variable SHELL_VERBOSITY in my phpunit.xml.dist to retrieve the previous behavior.

Maybe it is good to fix it like it but it can generate behavior change, or maybe I miss something 😄

Regards,

Mickaël

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants