Przeglądaj źródła

ZF-8353 - Fix unittest failure issue which was caused by a change in timeout handling, changed the testsuite to go along with this handling.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19099 44c647ce-9c0f-0410-b52a-842ac1e357ba
beberlei 16 lat temu
rodzic
commit
315cbf6a9d

+ 6 - 1
tests/Zend/Http/Client/CurlTest.php

@@ -182,7 +182,12 @@ class Zend_Http_Client_CurlTest extends Zend_Http_Client_CommonHttpTests
     {
         $adapter = new Zend_Http_Client_Adapter_Curl();
         $this->client->setAdapter($adapter);
-        $adapter->setConfig(array('timeout' => 1, 'curloptions' => array(CURLOPT_FOLLOWLOCATION => true)));
+        $adapter->setConfig(array(
+            'curloptions' => array(
+                CURLOPT_FOLLOWLOCATION => true,
+                CURLOPT_TIMEOUT => 1,
+            ))
+        );
 
         $this->client->setUri($this->baseuri . 'testRedirections.php');
 

+ 1 - 1
tests/Zend/Http/Client/_files/testRedirections.php

@@ -24,7 +24,7 @@ if (! isset($_GET['redirection'])) $_GET['redirection'] = 0;
 $_GET['redirection']++;
 $https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off';
 
-if ($_GET['redirection'] < 4) {
+if (!isset($_GET['redirection']) || $_GET['redirection'] < 4) {
     $target = 'http' . ($https ? 's://' : '://')  . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
     header('Location: ' . $target . '?redirection=' . $_GET['redirection']);
 } else {