예제 #1
0
 public function run()
 {
     $i = new ChannelInputStream('input');
     $o = new ChannelOutputStream('stdout');
     while ($i->available()) {
         $o->write($i->read());
     }
 }
예제 #2
0
 public function input()
 {
     $r = ChannelWrapper::capture(newinstance(Runnable::class, [], ['run' => function () {
         $i = new ChannelInputStream('input');
         $o = new ChannelOutputStream('stdout');
         while ($i->available()) {
             $o->write($i->read());
         }
     }]), ['input' => '+OK Piped input']);
     $this->assertEquals('+OK Piped input', $r['stdout']);
 }