Make SFTPLargeFileTest compatible with php5 branch.

This commit is contained in:
Andreas Fischer 2014-12-12 17:46:43 +01:00
parent 81ae4c924e
commit e0f8892521

View File

@ -6,8 +6,6 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
require_once 'Crypt/Base.php';
class Functional_Net_SFTPLargeFileTest extends PhpseclibFunctionalTestCase
{
protected $sftp;
@ -19,13 +17,13 @@ class Functional_Net_SFTPLargeFileTest extends PhpseclibFunctionalTestCase
self::markTestSkipped('This test depends on mcrypt for performance.');
}
parent::setUpBeforeClass();
self::ensureConstant('CRYPT_AES_MODE', CRYPT_MODE_MCRYPT);
self::ensureConstant('CRYPT_BLOWFISH_MODE', CRYPT_MODE_MCRYPT);
self::ensureConstant('CRYPT_DES_MODE', CRYPT_MODE_MCRYPT);
self::ensureConstant('CRYPT_RC2_MODE', CRYPT_MODE_MCRYPT);
self::ensureConstant('CRYPT_RC4_MODE', CRYPT_MODE_MCRYPT);
self::ensureConstant('CRYPT_RIJNDAEL_MODE', CRYPT_MODE_MCRYPT);
self::ensureConstant('CRYPT_TWOFISH_MODE', CRYPT_MODE_MCRYPT);
self::ensureConstant('CRYPT_AES_MODE', Crypt_Base::ENGINE_MCRYPT);
self::ensureConstant('CRYPT_BLOWFISH_MODE', Crypt_Base::ENGINE_MCRYPT);
self::ensureConstant('CRYPT_DES_MODE', Crypt_Base::ENGINE_MCRYPT);
self::ensureConstant('CRYPT_RC2_MODE', Crypt_Base::ENGINE_MCRYPT);
self::ensureConstant('CRYPT_RC4_MODE', Crypt_Base::ENGINE_MCRYPT);
self::ensureConstant('CRYPT_RIJNDAEL_MODE', Crypt_Base::ENGINE_MCRYPT);
self::ensureConstant('CRYPT_TWOFISH_MODE', Crypt_Base::ENGINE_MCRYPT);
}
public function setUp()
@ -59,7 +57,7 @@ class Functional_Net_SFTPLargeFileTest extends PhpseclibFunctionalTestCase
$filename = 'file-large-from-local.txt';
$this->assertTrue(
$this->sftp->put($filename, $tmp_filename, NET_SFTP_LOCAL_FILE),
$this->sftp->put($filename, $tmp_filename, Net_SFTP::SOURCE_LOCAL_FILE),
'Failed asserting that local file could be successfully put().'
);