Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Use stdout stream for reports when available #97

Open
wants to merge 2 commits into
base: 9.0
Choose a base branch
from

Conversation

kl-he
Copy link

@kl-he kl-he commented Oct 20, 2021

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.

Klaus Heigren added 2 commits October 19, 2021 13:12
Use stdout stream for reports when available. This avoids "Headers
already sent" types of issues, when manipulating a session during
testing.
The constant is defined as fopen('php://stdout', 'w'), not php://stdout.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant