带有'session_regenerate_id()消息的'PHPUnit_Framework_Error_Warning':无法重新生成会话ID - 已发送的标头'

I ran into this problem writing controller tests for logging in. I found an answer for the Yii framework but I use Zend. The answer was to use ob_start() but it didn't work for me until I figured out where to put it. I ended up landing on having it at the top of my Bootstrap.php file. If anyone else has figured out a better way of doing this please let me know

Please try to set:

Zend_Session::$_unitTestEnabled = true;

In your tests, could work.

Another solution could be to redirect the PHPUnit output, so that it doesn't interrupt the html output.

phpunit --stderr controllerTest.php