Browse Source

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

tags/2.0.10
Carsten Brandt 8 years ago
parent
commit
2bd301d1fe
  1. 5
      tests/framework/base/SecurityTest.php

5
tests/framework/base/SecurityTest.php

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

Loading…
Cancel
Save