在运行Zend应用程序的所有测试时,出现了以下这行代码:
protected function _getResp()
{
if (is_null($this->_response))
$this->_response = new Zend_Controller_Response_Http();
return $this->_response;
}
.......
$this->_getResp()->setHeader('Content-Type', 'text/html; charset=utf-8', true);
产生以下错误:
Zend_Controller_Response_Exception: 无法发送标头,因为标头已经在 /usr/share/php5/PEAR/PHPUnit/Util/Printer.php 的第173行被发送。
因此,测试失败。