Pārlūkot izejas kodu

ZF-7840: added conditional test to prevent segfaults

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19253 44c647ce-9c0f-0410-b52a-842ac1e357ba
bate 16 gadi atpakaļ
vecāks
revīzija
8296048825
2 mainītis faili ar 22 papildinājumiem un 2 dzēšanām
  1. 11 0
      tests/TestConfiguration.php.dist
  2. 11 2
      tests/Zend/Uri/HttpTest.php

+ 11 - 0
tests/TestConfiguration.php.dist

@@ -629,6 +629,17 @@ define('TESTS_ZEND_SERVICE_RECAPTCHA_MAILHIDE_PRIVATE_KEY', 'private mailhide ke
 define('TESTS_ZEND_SOAP_AUTODISCOVER_ONLINE_SERVER_BASEURI', false);
 
 /**
+ * Zend_Uri tests
+ *
+ * Setting CRASH_TEST_ENABLED to true will enable some tests that may
+ * potentially crash PHP on some systems, due to very deep-nesting regular
+ * expressions.
+ * 
+ * Only do this if you know what you are doing!
+ */
+define('TESTS_ZEND_URI_CRASH_TEST_ENABLED', false);
+
+/**
  * Zend_Validate tests
  *
  * Set ONLINE_ENABLED if you wish to run validators that require network 

+ 11 - 2
tests/Zend/Uri/HttpTest.php

@@ -31,6 +31,11 @@ require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'TestHe
 require_once 'Zend/Uri.php';
 
 /**
+ * @see Zend_Uri_Http
+ */
+require_once 'Zend/Uri/Http.php';
+
+/**
  * PHPUnit test case
  */
 require_once 'PHPUnit/Framework/TestCase.php';
@@ -198,7 +203,7 @@ class Zend_Uri_HttpTest extends PHPUnit_Framework_TestCase
      * Test that setQuery() can handle unencoded query parameters (as other
      * browsers do), ZF-1934
      *
-     * @link   http://framework.zend.com/issues/browse/ZF-1934
+     * @group ZF-1934
      * @return void
      */
     public function testUnencodedQueryParameters()
@@ -265,10 +270,14 @@ class Zend_Uri_HttpTest extends PHPUnit_Framework_TestCase
     /**
      * Test that an extremely long URI does not break things up
      *
-     * @link http://framework.zend.com/issues/browse/ZF-3712
+     * @group ZF-3712
+     * @group ZF-7840
      */
     public function testVeryLongUriZF3712()
     {
+        if(!defined('TESTS_ZEND_URI_CRASH_TEST_ENABLED') || constant('TESTS_ZEND_URI_CRASH_TEST_ENABLED') == false) {
+            $this->markTestSkipped('The constant TESTS_ZEND_URI_CRASH_TEST_ENABLED has to be defined and true to allow the test to work.');
+        }
         $uri = file_get_contents(dirname(realpath(__FILE__)) . DIRECTORY_SEPARATOR .
            '_files' . DIRECTORY_SEPARATOR . 'testVeryLongUriZF3712.txt');