Index: tests/Zend/XmlRpc/ClientTest.php =================================================================== --- tests/Zend/XmlRpc/ClientTest.php (revision 24104) +++ tests/Zend/XmlRpc/ClientTest.php (working copy) @@ -717,7 +717,25 @@ $this->xmlrpcClient->call('get', array(1)) ); } + + /** + * @group ZF-1897 + */ + public function testCallFailsWhenHttpClientDoesNotTrimChunkedResponse() + { + $baseUri = "http://foo:80"; + $this->httpAdapter = new Zend_Http_Client_Adapter_Test(); + $this->httpClient = new Zend_Http_Client(null, array('adapter' => $this->httpAdapter)); + + $respBody = file_get_contents(dirname(__FILE__) . "/_files/ZF1897-response-chunked.txt"); + $this->httpAdapter->setResponse($respBody); + $this->xmlrpcClient = new Zend_XmlRpc_Client($baseUri); + $this->xmlrpcClient->setHttpClient($this->httpClient); + + $this->assertEquals('FOO', $this->xmlrpcClient->call('foo')); + } + // Helpers public function setServerResponseTo($nativeVars) { Index: tests/Zend/XmlRpc/_files/ZF1897-response-chunked.txt =================================================================== --- tests/Zend/XmlRpc/_files/ZF1897-response-chunked.txt (revision 0) +++ tests/Zend/XmlRpc/_files/ZF1897-response-chunked.txt (revision 0) @@ -0,0 +1,22 @@ +HTTP/1.1 200 OK +Date: Thu, 06 Sep 2007 14:58:44 GMT +Server: Apache/2.0.54 (Debian GNU/Linux) DAV/2 SVN/1.1.4 mod_python/3.1.3 Python/2.3.5 mod_ssl/2.0.54 OpenSSL/0.9.7e PHP/5.1.6 +X-Powered-By: PHP/5.1.6 +Connection: close +Transfer-Encoding: chunked +Content-Type: text/html; charset=iso-8859-1 + +92 + + + + + + + FOO + + + + +0 +