Repository navigation
Conversation
The order of the application and console events for a successful command, exit code changes in TERMINATE, a COMMAND_ERROR listener handling a command's exception, and an unhandled command exception reaching APPLICATION_ERROR were not covered by tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Approved |
heelc29
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Tests only. The event layer of
Application::execute()had little coverage; together with the regression tests in the bug-fix PRs, this covers eachConsoleEventspath:testEventsAreDispatchedInOrderForASuccessfulCommand:application.before_execute,console.before_command_execute,console.terminate,application.after_execute, and no error events;testTerminateEventCanChangeTheExitCode: aTERMINATElistener sees exit code 0 and the command and changes the exit code;testCommandErrorCanBeHandledByEventListener: aCOMMAND_ERRORlistener sees the command, the error and its code,setExitCode(0)makes the application exit with 0,TERMINATEstill runs,APPLICATION_ERRORdoes not, and nothing is rendered;testUnhandledCommandErrorReachesTheApplicationErrorEvent: an unhandled command exception goes throughCOMMAND_ERROR,TERMINATEandAPPLICATION_ERROR(notAFTER_EXECUTE), is rendered, and its code becomes the exit code.Covered elsewhere:
enableCommand()(#31),--helpwith an unknown command (#33),ApplicationErrorEvent/CommandErrorEvent::setExitCode(), exit-code limits and aCOMMAND_ERRORexit code reaching the process (#37); the existing tests coverdisableCommand()and the unknown-commandCOMMAND_ERRORpath.The tests are inserted at a different place in
ApplicationTestthan those of the other open PRs, so they merge without conflicts.Testing Instructions
vendor/bin/phpunit— the new tests pass on4.x-devas they pin the current behaviour.Documentation Changes Required
None.
🤖 Generated with Claude Code