Skip to content

Various output buffer issues #5851

Open
@kkmuffme

Description

Q A
PHPUnit version 11.1.3
PHP version 8.2.x, 8.3.x
Installation Method Composer / PHAR

Summary

  1. when a test (or any function called from the test) flushes or cleans the output buffer, this incorrectly changes the output making tests pass that fail with expectOutputString and/or would cause a PHP notice when the code is actually executed
  2. if a test ends but starts a new output buffer, no error is reported, since only the ob level is compared instead of comparing the output
  3. when a test (or any function called from the test) register a non-removable ob callback, this leads to complete failure/unexpected behavior
  4. non-removable ob callbacks cannot currently be tested
  5. if stopping output buffering fails, it will try again creating the same notices twice

I will provide a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething is broken

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions