Test PHP headers with PHPUnit

后端 未结 7 1452
不思量自难忘°
不思量自难忘° 2020-11-30 22:05

I\'m trying to use PHPunit to test a class that outputs some custom headers.

The problem is that on my machine this:



        
7条回答
  •  清歌不尽
    2020-11-30 22:16

    I had a more radical solution, in order to use $_SESSION inside my tested/included files. I edited one of the PHPUnit files at ../PHPUnit/Utils/Printer.php to have a "session_start();" before the command "print $buffer".

    It worked for me like a charm. But I think "joonty" user's solution is the best of all up to now.

提交回复
热议问题