// output behavior.
break;
}
+ if ( $status['name'] === 'MediaWikiTestCase::wfResetOutputBuffersBarrier' ) {
+ // Unit testing barrier to prevent this function from breaking PHPUnit.
+ break;
+ }
if ( !ob_end_clean() ) {
// Could not remove output buffer handler; abort now
// to avoid getting in some kind of infinite loop.
DeferredUpdates::clearPendingUpdates();
+ ob_start( 'MediaWikiTestCase::wfResetOutputBuffersBarrier' );
}
protected function addTmpFiles( $files ) {
}
protected function tearDown() {
+ $status = ob_get_status();
+ if ( isset( $status['name'] ) && $status['name'] === 'MediaWikiTestCase::wfResetOutputBuffersBarrier' ) {
+ ob_end_flush();
+ }
+
$this->called['tearDown'] = true;
// Cleaning up temporary files
foreach ( $this->tmpFiles as $fileName ) {
self::assertFalse( self::tagMatch( $matcher, $actual, $isHtml ), $message );
}
+
+ /**
+ * Used as a marker to prevent wfResetOutputBuffers from breaking PHPUnit.
+ * @return string
+ */
+ public static function wfResetOutputBuffersBarrier( $buffer ) {
+ return $buffer;
+ }
}