I'm trying to make some unit tests using a setcookie() function in a pretty good IDE PhpStorm. But I get a following error every time:
Cannot modify header information - headers already sent by (output started at /tmp/phpunit.php:418)
Probably the reason of this error is print('some text') with flush() before setcookie() calling. But flushing is performed in a /tmp/phpunit.php file generated by PhpStorm. While setcookie() is called from my sources. So I can't edit the generated file to do some kind of output buffering. Also there is some another moment: PhpStorm executes /tmp/phpunit.php script like this:
/usr/bin/php /tmp/phpunit.php -config /var/www/.../protected/tests/phpunit.xml d /var/www/.../protected/tests/unit/user
Please help me to workaround this issue. How can I run unit tests from PhpStorm directly?