Kaynağa Gözat

Fixing HTTP client tests to skip if server returns 501 on TRACE requests (e.g. lighttpd)

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@16975 44c647ce-9c0f-0410-b52a-842ac1e357ba
shahar 16 yıl önce
ebeveyn
işleme
c6807d1822
1 değiştirilmiş dosya ile 4 ekleme ve 4 silme
  1. 4 4
      tests/Zend/Http/Client/CommonHttpTests.php

+ 4 - 4
tests/Zend/Http/Client/CommonHttpTests.php

@@ -126,7 +126,7 @@ abstract class Zend_Http_Client_CommonHttpTests extends PHPUnit_Framework_TestCa
         ));
         ));
 
 
         $res = $this->client->request(Zend_Http_Client::TRACE);
         $res = $this->client->request(Zend_Http_Client::TRACE);
-        if ($res->getStatus() == 405) {
+        if ($res->getStatus() == 405 || $res->getStatus() == 501) {
             $this->markTestSkipped("Server does not allow the TRACE method");
             $this->markTestSkipped("Server does not allow the TRACE method");
         }
         }
 
 
@@ -275,7 +275,7 @@ abstract class Zend_Http_Client_CommonHttpTests extends PHPUnit_Framework_TestCa
         $this->client->setHeaders($acceptHeader);
         $this->client->setHeaders($acceptHeader);
 
 
         $res = $this->client->request('TRACE');
         $res = $this->client->request('TRACE');
-        if ($res->getStatus() == 405) {
+        if ($res->getStatus() == 405 || $res->getStatus() == 501) {
             $this->markTestSkipped("Server does not allow the TRACE method");
             $this->markTestSkipped("Server does not allow the TRACE method");
         }
         }
         
         
@@ -305,7 +305,7 @@ abstract class Zend_Http_Client_CommonHttpTests extends PHPUnit_Framework_TestCa
         $this->client->setHeaders($headers);
         $this->client->setHeaders($headers);
 
 
         $res = $this->client->request('TRACE');
         $res = $this->client->request('TRACE');
-        if ($res->getStatus() == 405) {
+        if ($res->getStatus() == 405 || $res->getStatus() == 501) {
             $this->markTestSkipped("Server does not allow the TRACE method");
             $this->markTestSkipped("Server does not allow the TRACE method");
         }
         }
         
         
@@ -343,7 +343,7 @@ abstract class Zend_Http_Client_CommonHttpTests extends PHPUnit_Framework_TestCa
 
 
         $this->client->setHeaders($headers);
         $this->client->setHeaders($headers);
         $res = $this->client->request('TRACE');
         $res = $this->client->request('TRACE');
-        if ($res->getStatus() == 405) {
+        if ($res->getStatus() == 405 || $res->getStatus() == 501) {
             $this->markTestSkipped("Server does not allow the TRACE method");
             $this->markTestSkipped("Server does not allow the TRACE method");
         }
         }
         $body = strtolower($res->getBody());
         $body = strtolower($res->getBody());