Explorar o código

PHP 5.2 support for invalid JSON config files

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24705 44c647ce-9c0f-0410-b52a-842ac1e357ba
rob %!s(int64=13) %!d(string=hai) anos
pai
achega
637717511f
Modificáronse 1 ficheiros con 10 adicións e 2 borrados
  1. 10 2
      tests/Zend/Config/JsonTest.php

+ 10 - 2
tests/Zend/Config/JsonTest.php

@@ -188,7 +188,11 @@ class Zend_Config_JsonTest extends PHPUnit_Framework_TestCase
 
     public function testRaisesExceptionOnInvalidJsonMarkup()
     {
-        $this->setExpectedException('Zend_Json_Exception', 'Syntax error');
+        if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+            $this->setExpectedException('Zend_Config_Exception', 'Error parsing JSON data');
+        } else {
+            $this->setExpectedException('Zend_Json_Exception', 'Syntax');
+        }
         $config = new Zend_Config_Json($this->_iniFileInvalid);
     }
 
@@ -275,7 +279,11 @@ EOJ;
         }
         $json = '{"env":"ZEND_CONFIG_JSON_ENV","path":"ZEND_CONFIG_JSON_ENV_PATH/tests","int":ZEND_CONFIG_JSON_ENV_INT}';
 
-        $this->setExpectedException('Zend_Json_Exception', 'Syntax');
+        if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+            $this->setExpectedException('Zend_Config_Exception', 'Error parsing JSON data');
+        } else {
+            $this->setExpectedException('Zend_Json_Exception', 'Syntax');
+        }
         $config = new Zend_Config_Json($json, null, array('ignore_constants' => true));
     }
 }