mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 03:42:40 +00:00
Merge branch '1.0' into 2.0
This commit is contained in:
commit
7ce104b12c
@ -2860,6 +2860,16 @@ class SSH2
|
||||
return $this->_disconnect(NET_SSH2_DISCONNECT_BY_APPLICATION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the currently configured timeout
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function getTimeout()
|
||||
{
|
||||
return $this->timeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Timeout
|
||||
*
|
||||
|
@ -110,6 +110,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 \phpseclib\Net\SSH2
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user