HomePhabricator

Fix so wfResetOutputBuffers doesn't break unit tests

Authored by Anomie.

Description

Fix so wfResetOutputBuffers doesn't break unit tests

If something being unit tested calls wfResetOutputBuffers(), it'll break
PHPUnit's attempt to capture output in order to fail tests. In the old
version we're currently using for Jenkins it will throw a warning
"ob_end_clean(): failed to delete buffer. No buffer to delete", while in
newer versions it'll detect that its buffer was removed and fail the
test as risky instead.

The solution here is to have MediaWikiTestCase add a buffer with a known
name in setUp() (and remove it in tearDown()), and have
wfResetOutputBuffers() stop when it sees that known name on the stack.

Bug: T109843
Change-Id: I8acd91ec9dd9c6d78a5d91d96202249f571d5d83

Details

Committed
AnomieAug 21 2015, 4:24 PM
Parents
rMW8c76a6f0ff0a: Unbreak wfResetOutputBuffers
Branches
Unknown
Tags
Unknown
ChangeId
I8acd91ec9dd9c6d78a5d91d96202249f571d5d83