phpunit-wrapper icon indicating copy to clipboard operation
phpunit-wrapper copied to clipboard

Use stdout stream for reports when available

Open kl-he opened this issue 4 years ago • 0 comments

Use stdout stream for reports when available. This avoids "Headers already sent" types of issues, when manipulating a session during testing.

When manipulating headers during acceptance testing, those tests would fail, if a report with output was activated. This could be the situation if running Codeception tests from PHPStorm.

A workaround is to use ob_start() in a bootstrap as described here https://stackoverflow.com/questions/31175636/headers-already-sent-running-unit-tests-in-phpstorm and here https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000404160-Codeception-test-reports-Headers-already-sent-in-vendor-phpunit-phpunit-src-Util-Printer-php-on-line-109.

Using ob_start(), the user has to wait for all tests to complete, before the report-output is available.

kl-he avatar Oct 20 '21 12:10 kl-he