Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Add PausePrompt fallback #53660

Merged
merged 2 commits into from
Nov 25, 2024
Merged

Conversation

jwpage
Copy link
Contributor

@jwpage jwpage commented Nov 25, 2024

This PR adds a fallback for the \Laravel\Prompts\PausePrompt to the Illuminate\Console\Concerns\ConfiguresPrompts to fallback to using a Symfony question.

This allows users to use $pendingCommand->expectsQuestion('Press enter to continue', '') in their tests when there is a PausePrompt in their command.

The fallback discards the result of the question and instead uses the result of the underlying PausePrompt::value(), as is the expected behaviour when not using the fallback.

In the test, it adds the current test case instance into the test command constructor so that we can assert upon the prompt's return value.

@taylorotwell taylorotwell merged commit c2e59b5 into laravel:11.x Nov 25, 2024
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants