|
|
@@ -717,6 +717,24 @@ class Zend_XmlRpc_ClientTest extends PHPUnit_Framework_TestCase
|
|
|
$this->xmlrpcClient->call('get', array(1))
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @group ZF-1897
|
|
|
+ */
|
|
|
+ public function testHandlesLeadingOrTrailingWhitespaceInChunkedResponseProperly()
|
|
|
+ {
|
|
|
+ $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)
|