From 7a32f935a24b940c51b2be7cfbc33defefa54d3f Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel Date: Mon, 12 Apr 2010 10:51:07 +0200 Subject: [PATCH] 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). --- framework/Http/lib/Horde/Http/Response/Mock.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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; } } -- 2.11.0