Skip to content

Commit e0a5ff5

Browse files
committed
fix: tests on non interactive mode
1 parent 4c2bab4 commit e0a5ff5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Input/Reader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ public function readHidden($default = null, callable $fn = null): mixed
125125
}
126126
// @codeCoverageIgnoreEnd
127127

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

132132
echo PHP_EOL;
133133

tests/bootstrap.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010
*/
1111

1212
require_once __DIR__ . '/../vendor/autoload.php';
13+
14+
defined('RUNNING_TEST') || define('RUNNING_TEST', 1);
15+
defined('STDIN') || define('STDIN', fopen('php://stdin', 'r'));

0 commit comments

Comments
 (0)