Beispiel #1
0
 public function testStreamMode()
 {
     $terminal = TerminalTestUtil::getTerminalInstance();
     $config = shell_exec("stty -g < {$terminal->getTty()}");
     $terminal->silentStreamMode();
     $this->assertEquals('silentStream', $terminal->getMode());
     $this->assertEquals($config, $terminal->getPreviousConfig());
     $terminal->normalMode();
     $this->assertEquals('normal', $terminal->getMode());
     $this->assertEquals($config, $terminal->getPreviousConfig());
 }
 public function testSend()
 {
     $reflection = new \ReflectionClass($this->abstractToolFQN);
     $method = $reflection->getMethod('send');
     $method->setAccessible(true);
     $terminal = TerminalTestUtil::getTerminalInstance();
     $output = $this->getMockForAbstractClass($this->outputStreamInterfaceFQN);
     $output->expects($this->once())->method('write')->with('hello');
     $terminal->setOutput($output);
     $tool = $this->getMockForAbstractClass($this->abstractToolFQN, [$terminal]);
     $method->invokeArgs($tool, ['hello']);
 }
Beispiel #3
0
 public static function getScreenToolInstance()
 {
     $terminal = TerminalTestUtil::getTerminalInstance();
     return new ScreenTool($terminal);
 }