mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-19 07:07:58 +08:00
fix test for PHP 7.1, expect deprecation message for mcrypt_create_iv()
This commit is contained in:
@@ -935,6 +935,11 @@ TEXT;
|
||||
if (DIRECTORY_SEPARATOR === '\\' && $functions['random_bytes'] === false && $functions['openssl_random_pseudo_bytes'] === false && $functions['mcrypt_create_iv'] === false ) {
|
||||
$this->setExpectedException('yii\base\Exception', 'Unable to generate a random key');
|
||||
}
|
||||
// Function mcrypt_create_iv() is deprecated since PHP 7.1
|
||||
if (version_compare(PHP_VERSION, '7.1.0', '>=') && $functions['random_bytes'] === false && $functions['mcrypt_create_iv'] === true) {
|
||||
$this->setExpectedException('yii\base\ErrorException', 'Function mcrypt_create_iv() is deprecated');
|
||||
}
|
||||
|
||||
static::$functions = $functions;
|
||||
|
||||
// test various string lengths
|
||||
|
||||
Reference in New Issue
Block a user