PHPUnit - Warning: "Header already sent"
You could try setting PHPUnit's @runInSeparateProcess flag, as discussed here.

However, it sounds as though you're attempting to use PHPUnit for acceptance or integration tests, when it's really designed to be used for unit testing.

A couple of options:


You could mock the JsonHelper::sendJsonHeaders method, but that may prove tricky;
You could use something like Behat for integration testing. This may be more appropriate for a controller.


Stephen