Zend_Session: Session must be started before any output has been sent to the browser

后端 未结 7 800
心在旅途
心在旅途 2021-01-19 04:07

I\'ve run into this issue before, but I can\'t remember how to solve it. I have created a bare bones (can\'t get any simpler) controller, and am just trying to echo somethin

相关标签:
7条回答
  • 2021-01-19 04:32

    I found a similar post on this problem:

    PHPUnit output causing Zend_Session exceptions

    I had the same problem but the solution that was proposed on the previous link did not worked for me, so after some testing I found that there is a variable on the class Zend_Session

     /**
     * Whether or not Zend_Session is being used with unit tests
     *
     * @internal
     * @var bool
     */
    public static $_unitTestEnabled = false;
    

    If you set this variable to "true" the phpunit execution works without any problem. At least that is what happened in my case.

    Hope this help

    0 讨论(0)
提交回复
热议问题