mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-05 13:07:53 +00:00
Merge pull request #241 from mpscholten/ssh2-tests
Added some simple Net_SSH2 tests * mpscholten/ssh2-tests: Added some simple Net_SSH2 tests Conflicts: tests/Net/SSH2Test.php
This commit is contained in:
commit
b676cc2690
@ -2835,6 +2835,20 @@ class Net_SSH2
|
||||
$this->quiet_mode = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether Quiet Mode is enabled or not
|
||||
*
|
||||
* @see Net_SSH2::enableQuietMode()
|
||||
* @see Net_SSH2::disableQuietMode()
|
||||
*
|
||||
* @access public
|
||||
* @return boolean
|
||||
*/
|
||||
function isQuietModeEnabled()
|
||||
{
|
||||
return $this->quiet_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable request-pty when using exec()
|
||||
*
|
||||
@ -2855,6 +2869,20 @@ class Net_SSH2
|
||||
$this->request_pty = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether request-pty is enabled or not
|
||||
*
|
||||
* @see Net_SSH2::enablePTY()
|
||||
* @see Net_SSH2::disablePTY()
|
||||
*
|
||||
* @access public
|
||||
* @return boolean
|
||||
*/
|
||||
function isPTYEnabled()
|
||||
{
|
||||
return $this->request_pty;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets channel data
|
||||
*
|
||||
|
@ -70,6 +70,48 @@ class Net_SSH2Test extends PhpseclibTestCase
|
||||
$this->assertEquals($expected, $identifier);
|
||||
}
|
||||
|
||||
public function testGetExitStatusIfNotConnected()
|
||||
{
|
||||
$ssh = $this->createSSHMock();
|
||||
|
||||
$this->assertFalse($ssh->getExitStatus());
|
||||
}
|
||||
|
||||
public function testPTYIDefaultValue()
|
||||
{
|
||||
$ssh = $this->createSSHMock();
|
||||
$this->assertFalse($ssh->isPTYEnabled());
|
||||
}
|
||||
|
||||
public function testEnablePTY()
|
||||
{
|
||||
$ssh = $this->createSSHMock();
|
||||
|
||||
$ssh->enablePTY();
|
||||
$this->assertTrue($ssh->isPTYEnabled());
|
||||
|
||||
$ssh->disablePTY();
|
||||
$this->assertFalse($ssh->isPTYEnabled());
|
||||
}
|
||||
|
||||
public function testQuietModeDefaultValue()
|
||||
{
|
||||
$ssh = $this->createSSHMock();
|
||||
|
||||
$this->assertFalse($ssh->isQuietModeEnabled());
|
||||
}
|
||||
|
||||
public function testEnableQuietMode()
|
||||
{
|
||||
$ssh = $this->createSSHMock();
|
||||
|
||||
$ssh->enableQuietMode();
|
||||
$this->assertTrue($ssh->isQuietModeEnabled());
|
||||
|
||||
$ssh->disableQuietMode();
|
||||
$this->assertFalse($ssh->isQuietModeEnabled());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Net_SSH2
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user