mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-15 17:57:12 +00:00
Merge branch 'rposky'
This commit is contained in:
commit
9a356ba200
@ -2374,6 +2374,16 @@ class SSH2
|
||||
throw new ConnectionClosedException('Unexpected response to publickey authentication pt 2');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the currently configured timeout
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getTimeout(): int
|
||||
{
|
||||
return $this->timeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Timeout
|
||||
*
|
||||
|
@ -143,6 +143,16 @@ class SSH2UnitTest extends PhpseclibTestCase
|
||||
$this->assertSame('{' . spl_object_hash($ssh) . '}', $ssh->getResourceId());
|
||||
}
|
||||
|
||||
public function testGetTimeout(): void
|
||||
{
|
||||
$ssh = new SSH2('localhost');
|
||||
$this->assertEquals(10, $ssh->getTimeout());
|
||||
$ssh->setTimeout(0);
|
||||
$this->assertEquals(0, $ssh->getTimeout());
|
||||
$ssh->setTimeout(20);
|
||||
$this->assertEquals(20, $ssh->getTimeout());
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
protected function createSSHMock(): SSH2
|
||||
|
Loading…
Reference in New Issue
Block a user