2
0
Просмотр исходного кода

Fix ZF-12204. Patch by Martin Hujer.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24808 44c647ce-9c0f-0410-b52a-842ac1e357ba
rob 13 лет назад
Родитель
Сommit
efadcc021c
2 измененных файлов с 4 добавлено и 10 удалено
  1. 1 1
      library/Zend/Crypt/Rsa.php
  2. 3 9
      tests/Zend/Crypt/Rsa/RsaTest.php

+ 1 - 1
library/Zend/Crypt/Rsa.php

@@ -71,7 +71,7 @@ class Zend_Crypt_Rsa
     {
         if (!extension_loaded('openssl')) {
             require_once 'Zend/Crypt/Rsa/Exception.php';
-            throw new Zend_Crypt_Rsa_Exception('Zend_Crypt_Rsa requires openssl extention to be loaded.');
+            throw new Zend_Crypt_Rsa_Exception('Zend_Crypt_Rsa requires openssl extension to be loaded.');
         }
 
         // Set _hashAlgorithm property when we are sure, that openssl extension is loaded

+ 3 - 9
tests/Zend/Crypt/Rsa/RsaTest.php

@@ -40,16 +40,10 @@ class Zend_Crypt_RsaTest extends PHPUnit_Framework_TestCase
 
     public function setUp()
     {
-        try {
-            $rsaObject = new Zend_Crypt_Rsa();
-        } catch (Zend_Crypt_Rsa_Exception $e) {
-            if (strpos($e->getMessage(), 'requires openssl extension') !== false) {
-                $this->markTestSkipped($e->getMessage());
-            } else {
-                throw $e;
-            }
+        if (!extension_loaded('openssl')) {
+            $this->markTestSkipped('Zend_Crypt_Rsa requires openssl extension to be loaded.');
         }
-
+        
         $this->_testPemString = <<<RSAKEY
 -----BEGIN RSA PRIVATE KEY-----
 MIIBOgIBAAJBANDiE2+Xi/WnO+s120NiiJhNyIButVu6zxqlVzz0wy2j4kQVUC4Z