mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-23 15:18:31 +00:00
Tests: update for 3.0 branch
This commit is contained in:
parent
2aa8072410
commit
796270a254
@ -25,14 +25,6 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
|
|||||||
self::$exampleDataLength = 10000;
|
self::$exampleDataLength = 10000;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testBadHostname()
|
|
||||||
{
|
|
||||||
$this->setExpectedException('PHPUnit_Framework_Error_Notice');
|
|
||||||
|
|
||||||
$sftp = new SFTP('bad host name');
|
|
||||||
$sftp->login('username', 'password');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testConstructor()
|
public function testConstructor()
|
||||||
{
|
{
|
||||||
$sftp = new SFTP($this->getEnv('SSH_HOSTNAME'));
|
$sftp = new SFTP($this->getEnv('SSH_HOSTNAME'));
|
||||||
|
@ -183,24 +183,4 @@ abstract class PhpseclibTestCase extends PHPUnit\Framework\TestCase
|
|||||||
|
|
||||||
parent::assertNotContains($needle, $haystack, $message);
|
parent::assertNotContains($needle, $haystack, $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setExpectedException($name, $message = null, $code = null)
|
|
||||||
{
|
|
||||||
if (version_compare(PHP_VERSION, '7.0.0') < 0) {
|
|
||||||
parent::setExpectedException($name, $message, $code);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
switch ($name) {
|
|
||||||
case 'PHPUnit_Framework_Error_Notice':
|
|
||||||
case 'PHPUnit_Framework_Error_Warning':
|
|
||||||
$name = str_replace('_', '\\', $name);
|
|
||||||
}
|
|
||||||
$this->expectException($name);
|
|
||||||
if (!empty($message)) {
|
|
||||||
$this->expectExceptionMessage($message);
|
|
||||||
}
|
|
||||||
if (!empty($code)) {
|
|
||||||
$this->expectExceptionCode($code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user