prevent headers already sent when phpunit testing