codeigniter4 / CodeIgniter4

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
5.4k stars 1.9k forks source link

Cannot write test for `CLI::prompt()`, `CLI::input()` #6076

Closed kenjis closed 2 years ago

kenjis commented 2 years ago

If we write test code for a command that uses CLI::prompt(), and run the test, it waits for input for ever.

How can we write test?

https://github.com/codeigniter4/CodeIgniter4/blob/cf4641c6dce585314030cd55161485e6662b22c7/system/CLI/CLI.php#L181

kenjis commented 2 years ago

Fixed by #6335