Skip to content

Commit

Permalink
fix: tests on non interactive mode
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Feb 11, 2023
1 parent 4c2bab4 commit e0a5ff5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Input/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ public function readHidden($default = null, callable $fn = null): mixed
}
// @codeCoverageIgnoreEnd

shell_exec('stty -echo');
defined('RUNNING_TEST') || shell_exec('stty -echo');
$in = $this->read($default, $fn);
shell_exec('stty echo');
defined('RUNNING_TEST') || shell_exec('stty echo');

echo PHP_EOL;

Expand Down
3 changes: 3 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
*/

require_once __DIR__ . '/../vendor/autoload.php';

defined('RUNNING_TEST') || define('RUNNING_TEST', 1);
defined('STDIN') || define('STDIN', fopen('php://stdin', 'r'));

0 comments on commit e0a5ff5

Please sign in to comment.