public function testStreamResponseNamed()
{
if(!($this->client->getAdapter() instanceof Zend_Http_Client_Adapter_Stream)) {
$this->markTestSkipped('Current adapter does not support streaming');
return;
}
$this->client->setUri($this->baseuri . 'staticFile.jpg');
$outfile = tempnam(sys_get_temp_dir(), "outstream");
$this->client->setStream($outfile);
$response = $this->client->request();
$this->assertTrue($response instanceof Zend_Http_Response_Stream, 'Request did not return stream response!');
$this->assertTrue(is_resource($response->getStream()), 'Request does not contain stream!');
$this->assertEquals($outfile, $response->getStreamName());
$stream_read = stream_get_contents($response->getStream());
$file_read = file_get_contents($outfile);
$expected = $this->_getTestFileContents('staticFile.jpg');
$this->assertEquals($expected, $stream_read, 'Downloaded stream does not seem to match!');
$this->assertEquals($expected, $file_read, 'Downloaded file does not seem to match!');
}