Merge branch 'master' into php5

* master:
  Added some simple Net_SSH2 tests
This commit is contained in:
Andreas Fischer 2014-04-18 16:55:42 +02:00
commit a7da467819
2 changed files with 70 additions and 0 deletions

View File

@ -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
*

View File

@ -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
*/