mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-09 15:20:58 +00:00
Merge pull request #560 from bantu/php-5.2-functional-gmp
Make SCP test on 5.2 run by allowing bcmath. * bantu/php-5.2-functional-gmp: Allow SCP test to run on 5.2 by not depending on GMP, but also allowing bcmath.
This commit is contained in:
commit
5a0c27a725
@ -14,11 +14,6 @@ class Functional_Net_SCPSSH2UserStoryTest extends PhpseclibFunctionalTestCase
|
|||||||
|
|
||||||
static public function setUpBeforeClass()
|
static public function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
if (getenv('TRAVIS') && version_compare(PHP_VERSION, '5.3.0', '<')) {
|
|
||||||
self::markTestIncomplete(
|
|
||||||
'This test fails on Travis CI on PHP 5.2 due to requiring GMP.'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
self::$remoteFile = uniqid('phpseclib-scp-ssh2-') . '.txt';
|
self::$remoteFile = uniqid('phpseclib-scp-ssh2-') . '.txt';
|
||||||
self::$exampleData = str_repeat('abscp12345', 1000);
|
self::$exampleData = str_repeat('abscp12345', 1000);
|
||||||
|
@ -10,7 +10,21 @@ abstract class PhpseclibFunctionalTestCase extends PhpseclibTestCase
|
|||||||
static public function setUpBeforeClass()
|
static public function setUpBeforeClass()
|
||||||
{
|
{
|
||||||
if (extension_loaded('runkit')) {
|
if (extension_loaded('runkit')) {
|
||||||
self::ensureConstant('MATH_BIGINTEGER_MODE', MATH_BIGINTEGER_MODE_GMP);
|
if (extension_loaded('gmp')) {
|
||||||
|
self::ensureConstant(
|
||||||
|
'MATH_BIGINTEGER_MODE',
|
||||||
|
MATH_BIGINTEGER_MODE_GMP
|
||||||
|
);
|
||||||
|
} elseif (extension_loaded('bcmath')) {
|
||||||
|
self::ensureConstant(
|
||||||
|
'MATH_BIGINTEGER_MODE',
|
||||||
|
MATH_BIGINTEGER_MODE_BCMATH
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
self::markTestSkipped(
|
||||||
|
'Should have gmp or bcmath extension for functional test.'
|
||||||
|
);
|
||||||
|
}
|
||||||
self::ensureConstant('CRYPT_HASH_MODE', CRYPT_HASH_MODE_HASH);
|
self::ensureConstant('CRYPT_HASH_MODE', CRYPT_HASH_MODE_HASH);
|
||||||
self::reRequireFile('Math/BigInteger.php');
|
self::reRequireFile('Math/BigInteger.php');
|
||||||
self::reRequireFile('Crypt/Hash.php');
|
self::reRequireFile('Crypt/Hash.php');
|
||||||
|
Loading…
Reference in New Issue
Block a user