Пример #1
0
 /**
  * @depends testCursorCellAccountsForDoubleWidthCharacters
  * @param Readline $readline
  */
 public function testCursorCellObeysCustomEchoAsterisk(Readline $readline)
 {
     $readline->setEcho('*');
     $this->assertEquals(3, $readline->getCursorPosition());
     $this->assertEquals(3, $readline->getCursorCell());
 }
Пример #2
0
 public function testDataEventWillBeForwarded()
 {
     $input = $this->getMock('React\\Stream\\ReadableStreamInterface');
     $output = $this->getMock('React\\Stream\\WritableStreamInterface');
     //$readline = $this->getMockBuilder('Clue\React\Stdio\Readline')->disableOriginalConstructor()->getMock();
     $readline = new Readline($input, $output);
     $stdio = new Stdio($this->loop, $input, $output, $readline);
     $stdio->on('data', $this->expectCallableOnceWith("hello\n"));
     $stdio->on('line', $this->expectCallableOnceWith('hello'));
     $readline->emit('data', array('hello'));
 }