Skip to content

[11.x] Add PausePrompt fallback#53660

Merged
taylorotwell merged 2 commits intolaravel:11.xfrom
jwpage:pauseprompt_fallback
Nov 25, 2024
Merged

[11.x] Add PausePrompt fallback#53660
taylorotwell merged 2 commits intolaravel:11.xfrom
jwpage:pauseprompt_fallback

Conversation

@jwpage
Copy link
Copy Markdown
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
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