Skip to content

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