prompts icon indicating copy to clipboard operation
prompts copied to clipboard

`info` not able to be tested against as output via `expectsOutput`

Open stevebauman opened this issue 10 months ago • 2 comments

Laravel Prompts Version

0.3.4

Laravel Version

11.41.3

PHP Version

8.2.27

Operating System & Version

macOS 15.2

Terminal Application

Mocked

Description

When using the info helper, I'm unable to test the output using expectsOutput on the artisan PendingCommand instance.

Steps To Reproduce

Test:

$this->artisan(ChangeTwilioDataCommand::class)
    // ...
    ->expectsOutput('Okay, cancelled.');
// fails
info('Okay, cancelled.'); 

// passes
$this->info('Okay, cancelled.');

Demo:

https://github.com/user-attachments/assets/9bce81f4-db38-41b0-968b-8091d7efffae

stevebauman avatar Feb 12 '25 19:02 stevebauman

None of the Laravel\Prompts\Note has a fallback when executed via tests which would cause this to occur.

crynobone avatar Feb 18 '25 03:02 crynobone

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

github-actions[bot] avatar Feb 18 '25 03:02 github-actions[bot]