Cannot send session cookie - headers already sent PHPUnit / Laravel

前端 未结 4 1420
小蘑菇
小蘑菇 2021-02-19 22:50

I have this strange problem when i call the parent::setUp() on my TestCase class for unit test a class when i run phpunit it throw me this error:

4条回答
  •  清酒与你
    2021-02-19 23:37

    One way to handle this in PHPUnit is to send output to stderr instead of stdout as is demonstrated by this answer.

    phpunit --stderr
    

    Or by adding stderr="true" in your phpunit.xml as is pointed out in this comment.

提交回复
热议问题