Unit Testing with items that need to send headers

后端 未结 11 1935
春和景丽
春和景丽 2020-12-03 01:01

I\'m currently working with PHPUnit to try and develop tests alongside what I\'m writing, however, I\'m currently working on writing the Session Manager, and am having issue

11条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-03 01:15

    Can't you use output buffering before starting the test? If you buffer everything that is output, you shouldn't have problems setting any headers as no output would have yet been sent to client at that point.

    Even if OB is used somewhere inside your classes, it is stackable and OB shouldn't affect what's going on inside.

提交回复
热议问题