/** * Typically called from Connection::getShell() * * @param Connection $connection * @param Terminal $terminal */ function __construct(Connection $connection, Terminal $terminal) { if (!$connection->isConnected()) { throw new NotConnectedException(); } if (!$connection->isAuthenticated()) { throw new NotAuthenticatedException(); } $this->shell_type = null; $this->connection = $connection; $this->terminal = $terminal; $this->resource = ssh2_shell($connection->getResource(), $terminal->getTerminalType(), $terminal->getEnv(), $terminal->getWidth(), $terminal->getHeight(), $terminal->getDimensionUnitType()); }
/** * @small */ public function testProperties() { $terminal = new Terminal(); $this->assertEquals(TerminalType::XTERM, $terminal->getTerminalType()); $this->assertEquals(TerminalUnit::CHARACTERS, $terminal->getDimensionUnitType()); }