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

Artisan asserts not working with textarea #131

Closed
james-astalty opened this issue Apr 12, 2024 · 4 comments
Closed

Artisan asserts not working with textarea #131

james-astalty opened this issue Apr 12, 2024 · 4 comments
Assignees
Labels

Comments

@james-astalty
Copy link

Laravel Prompts Version

0.1.18

Laravel Version

11.3.1

PHP Version

8.2

Operating System & Version

14.2

Terminal Application

zsh

Description

When using a text input, you can use expectsQuestion when running artisan tests but when using a textarea, the tests hang.

Steps To Reproduce

  1. Clone https://github.com/lioneaglesolutions/prompts-textarea-repro
  2. Run composer install
  3. Run ./vendor/bin/test
  4. The test will hang

I'm not quite sure if this is a Prompts issue or Framework issue but I had a dive into the source and could not work out what could be causing this.

@driesvints
Copy link
Member

@jessarcher @joetannenbaum do we still need to adjust something to make this work?

@jessarcher
Copy link
Member

jessarcher commented Apr 12, 2024

laravel/framework will need a Symfony fallback (which is also used for tests).

I think we can use https://symfony.com/doc/current/components/console/helpers/questionhelper.html#accept-multiline-answers. Failing that, we can probably fall back to a single-line prompt.

On a separate note, I'm curious why Symfony uses Ctrl+Z to submit on Windows and whether we should do the same.

Will jump onto this next week unless @joetannenbaum beats me to it.

@james-astalty
Copy link
Author

@jessarcher sorry I have 2 Github accounts going - does laravel/framework#51055 address this? I also found some other issues with assertions when writing those tests but need that PR to be merged as I want to keep the PRs separate and add more tests to fix the other assertion problems.

@jessarcher
Copy link
Member

laravel/framework#51055 should fix this 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants