mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-26 11:37:33 +00:00
SSH2: backport getTimeout()
This commit is contained in:
parent
9e758c180d
commit
34d00869e5
@ -2872,6 +2872,16 @@ class Net_SSH2
|
||||
return $this->_disconnect(NET_SSH2_DISCONNECT_BY_APPLICATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the currently configured timeout
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function getTimeout()
|
||||
{
|
||||
return $this->timeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Timeout
|
||||
*
|
||||
|
@ -106,6 +106,16 @@ class Unit_Net_SSH2UnitTest extends PhpseclibTestCase
|
||||
$this->assertFalse($ssh->isQuietModeEnabled());
|
||||
}
|
||||
|
||||
public function testGetTimeout()
|
||||
{
|
||||
$ssh = new Net_SSH2('localhost');
|
||||
$this->assertEquals(10, $ssh->getTimeout());
|
||||
$ssh->setTimeout(0);
|
||||
$this->assertEquals(0, $ssh->getTimeout());
|
||||
$ssh->setTimeout(20);
|
||||
$this->assertEquals(20, $ssh->getTimeout());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Net_SSH2
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user