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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.