File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -291,7 +291,7 @@ private function createStdin(LoopInterface $loop)
291291 }
292292
293293 if ($ this ->isTty ()) {
294- $ this ->originalTtyMode = shell_exec ('stty -g ' );
294+ $ this ->originalTtyMode = rtrim ( shell_exec ('stty -g ' ), PHP_EOL );
295295
296296 // Disable icanon (so we can fread each keypress) and echo (we'll do echoing here instead)
297297 shell_exec ('stty -icanon -echo ' );
Original file line number Diff line number Diff line change @@ -87,6 +87,20 @@ public function testStubCanCloseStdoutAndIsNotWritable()
8787 $ this ->assertEquals ('' , $ output );
8888 }
8989
90+ public function testStubCanEndWithoutOutput ()
91+ {
92+ $ output = $ this ->execExample ('php ../tests/stub/04-end.php ' );
93+
94+ $ this ->assertEquals ('' , $ output );
95+ }
96+
97+ public function testStubCanEndWithoutExtensions ()
98+ {
99+ $ output = $ this ->execExample ('php -n ../tests/stub/04-end.php ' );
100+
101+ $ this ->assertEquals ('' , $ output );
102+ }
103+
90104 public function testPeriodicExampleViaInteractiveModeQuitsImmediately ()
91105 {
92106 if (defined ('HHVM_VERSION ' )) {
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Clue \React \Stdio \Stdio ;
4+
5+ require __DIR__ . '/../../vendor/autoload.php ' ;
6+
7+ $ loop = React \EventLoop \Factory::create ();
8+
9+ $ stdio = new Stdio ($ loop );
10+ $ stdio ->end ();
11+
12+ $ loop ->run ();
You can’t perform that action at this time.
0 commit comments