From: Gunnar Wrobel Date: Mon, 12 Apr 2010 08:51:07 +0000 (+0200) Subject: The tests in the Feed package seem to be the only ones using the Mock Response. And... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7a32f935a24b940c51b2be7cfbc33defefa54d3f;p=horde.git The tests in the Feed package seem to be the only ones using the Mock Response. And they expect the class to have a constructor (which has been removed at some point in the Base class). --- diff --git a/framework/Http/lib/Horde/Http/Response/Mock.php b/framework/Http/lib/Horde/Http/Response/Mock.php index e12b747a1..acc32cd7b 100644 --- a/framework/Http/lib/Horde/Http/Response/Mock.php +++ b/framework/Http/lib/Horde/Http/Response/Mock.php @@ -16,8 +16,22 @@ */ class Horde_Http_Response_Mock extends Horde_Http_Response_Base { + /** + * Constructor + */ + public function __construct($uri, $stream, $headers = array()) + { + $this->uri = $uri; + $this->_stream = $stream; + $this->headers = $this->_parseHeaders($headers); + } + public function getBody() { - return $this->body; + $content = @stream_get_contents($this->_stream); + if ($content === false) { + throw new Horde_Http_Exception('Problem reading data from ' . $this->uri . ': ' . $php_errormsg); + } + return $content; } }