Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't mark closing all output buffers as risky #2154

Closed
mrclay opened this issue May 6, 2016 · 1 comment
Closed

Don't mark closing all output buffers as risky #2154

mrclay opened this issue May 6, 2016 · 1 comment

Comments

@mrclay
Copy link

mrclay commented May 6, 2016

I propose PHPUnit_Framework_RiskyTestError only be thrown if ob_get_level() > $this->outputBufferingLevel (or allow some other mechanism to allow this).

I do agree that a test that does not close its own output buffers should be considered risky, but code that empties all output buffers seems pretty reasonable to me.

E.g. 1: A framework wants to collect output to build a formal Response object.
E.g. 2: TestCase::stopOutputBuffering() empties all buffers, why is it just OK for PHPUnit to do it? ;)

If you're amenable to the idea I can send a PR.

@sebastianbergmann
Copy link
Owner

Duplicate of #2101.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants