Issues

ZF-7009: Keep function signature in "setResponse" and "addResponse"

Issue Type: Improvement Created: 2009-06-14T02:13:56.000+0000 Last Updated: 2009-06-14T06:52:59.000+0000 Status: Resolved Fix version(s): Reporter: Ziv Perry (zivperry) Assignee: Shahar Evron (shahar) Tags: - Zend_Http_Client

Related issues: Attachments:

Description

Zend_Http_Client_Adapter_Test::setResponse() and Zend_Http_Client_Adapter_Test::addResponse does not keep the same signature. Please change addResponse to act the same as setResponse e.g. convert response object to string.

Patch:

<pre class="highlight">
--- Test.org.php    2009-06-14 12:11:53.000000000 +0300
+++ Test.php    2009-06-14 12:11:05.000000000 +0300
@@ -168,10 +168,14 @@
     /**
      * Add another response to the response buffer.
      *
-     * @param string $response
+     * @param string Zend_Http_Response|$response
      */
     public function addResponse($response)
     {
+       if ($response instanceof Zend_Http_Response) {
+            $response = $response->asString();
+        }
+        
         $this->responses[] = $response;
     }

Comments

Posted by Shahar Evron (shahar) on 2009-06-14T06:52:42.000+0000

Patch applied + tests added in rev. 16066

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts