title: In PHPUnit, how do I prevent headers to be sent
body: <p>I have a test suite in PHPUnit. Some of the tests work with session (regenerate id, start etc). Those tests fails as PHPUnit already echoed something.  </p>
  
  <p>I am not really testing what are the headers. Is there a way to prevent headers from being sent in PHP? This is a CLI PHP, not a web server php module.</p>
  
  <p>(The solution I will implement if no other possibility is to build my own "fake" session handler for the unit tests purposes, aka DI, but I rather play with the real session if possible).</p>