while ( $this->db->trxLevel() > 0 ) {
$this->db->rollback();
}
-
- // don't ignore DB errors
- $this->db->ignoreErrors( false );
}
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 ) {
while ( $this->db->trxLevel() > 0 ) {
$this->db->rollback();
}
-
- // don't ignore DB errors
- $this->db->ignoreErrors( false );
}
// Restore mw globals
// of tidy. In that case however, we can not reliably detect whether a failing validation
// is due to malformed HTML, or caused by tidy not being installed as a command line tool.
// That would cause all HTML assertions to fail on a system that has no tidy installed.
- if ( !$GLOBALS['wgTidyInternal'] ) {
+ if ( !$GLOBALS['wgTidyInternal'] || !MWTidy::isEnabled() ) {
$this->markTestSkipped( 'Tidy extension not installed' );
}
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;
+ }
}