Unit tests fixes.

A PHPDoc fix
This commit is contained in:
Sokolovskyy Roman 2017-09-14 09:42:12 +02:00
parent 508f04fab8
commit c6020a4c42
3 changed files with 4 additions and 11 deletions

View File

@ -2288,7 +2288,7 @@ class X509
* *
* @param string $date in format date('D, d M Y H:i:s O') * @param string $date in format date('D, d M Y H:i:s O')
* @access private * @access private
* @return array * @return array|Element
*/ */
private function timeField($date) private function timeField($date)
{ {
@ -3432,7 +3432,7 @@ class X509
} }
return false; return false;
default: // Should be a key object (i.e.: \phpseclib\Crypt\RSA). default: // Should be a key object (i.e.: \phpseclib\Crypt\RSA).
$key = $key->getPublicKey('PKCS1'); $key = $key->getPublicKey();
break; break;
} }

View File

@ -78,14 +78,7 @@ class Unit_Crypt_BlowfishTest extends PhpseclibTestCase
$bf->setKey($key); $bf->setKey($key);
$bf->setIV(str_repeat("\0", $bf->getBlockLength() >> 3)); $bf->setIV(str_repeat("\0", $bf->getBlockLength() >> 3));
$engines = array( if (!$bf->isValidEngine($engine)) {
'PHP'=>\phpseclib\Crypt\Common\SymmetricKey::ENGINE_INTERNAL,
'Eval'=>\phpseclib\Crypt\Common\SymmetricKey::ENGINE_EVAL,
'mcrypt'=>\phpseclib\Crypt\Common\SymmetricKey::ENGINE_MCRYPT,
'OpenSSL'=>\phpseclib\Crypt\Common\SymmetricKey::ENGINE_OPENSSL,
);
if (!$bf->isValidEngine($engines[$engine])) {
self::markTestSkipped("Unable to initialize $engine engine"); self::markTestSkipped("Unable to initialize $engine engine");
} }
$bf->setPreferredEngine($engine); $bf->setPreferredEngine($engine);

View File

@ -29,7 +29,7 @@ class Unit_Crypt_TwofishTest extends PhpseclibTestCase
$key = pack('H*', '00000000000000000000000000000000'); $key = pack('H*', '00000000000000000000000000000000');
$tf->setKey($key); $tf->setKey($key);
if (!$tf->isValidEngine($engine)) { if (!$tf->isValidEngine($engine)) {
self::markTestSkipped('Unable to initialize $engine engine'); self::markTestSkipped("Unable to initialize $engine engine");
} }
$plaintext = pack('H*', '00000000000000000000000000000000'); $plaintext = pack('H*', '00000000000000000000000000000000');