fix test for PHP 7.1, expect deprecation message for mcrypt_create_iv()

This commit is contained in:
Carsten Brandt
2016-09-08 00:02:52 +02:00
parent 9a4ddd0f36
commit 2bd301d1fe

View File

@@ -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