-
Notifications
You must be signed in to change notification settings - Fork 116
Description
Laravel Prompts Version
0.1.24
Laravel Version
11.19.0
PHP Version
8.3.7
Operating System & Version
macOS 14.2
Terminal Application
WezTerm
Description
Working on some tests for Statamic... I did a code dive and found your Prompt::fake() helper, which is genious! 🔥
However, I've noticed an issue where tests containing Prompt::fake() pass when run in isolation...
But they fail when the whole test case and/or suite is ran...
We're hoping to use Prompt::fake() in our Statamic core test suite, but I can't get it to play nicely with other tests where we use $this->artisan().
It seems that PendingCommand is leaking mock expectations into other tests which use Prompt::fake(). I'm not sure how to solve, or if there's a way to improve Prompt::fake() for packages who wish to use it? 🤔
I've created a repo with an example test case to make it easier to reproduce, if that helps!
Any thoughts? 🙏
Steps To Reproduce
- Clone https://github.com/jesseleite/laravel-prompts-fake-issue
- Run
composer install - Run
phpunit- Notice that if you run each of the three sample tests in isolation, they all pass
- But if you run the whole test case/suite, the tests with
Prompt::fake()will fail

