dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Revert "Do not encode "'" as %27 (redirect loop in Opera 12)""
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
MediaWikiTestCase.php
diff --git
a/tests/phpunit/MediaWikiTestCase.php
b/tests/phpunit/MediaWikiTestCase.php
index
0ce056f
..
ac214a2
100644
(file)
--- a/
tests/phpunit/MediaWikiTestCase.php
+++ b/
tests/phpunit/MediaWikiTestCase.php
@@
-204,13
+204,11
@@
abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
while ( $this->db->trxLevel() > 0 ) {
$this->db->rollback();
}
while ( $this->db->trxLevel() > 0 ) {
$this->db->rollback();
}
-
- // don't ignore DB errors
- $this->db->ignoreErrors( false );
}
DeferredUpdates::clearPendingUpdates();
}
DeferredUpdates::clearPendingUpdates();
+ ob_start( 'MediaWikiTestCase::wfResetOutputBuffersBarrier' );
}
protected function addTmpFiles( $files ) {
}
protected function addTmpFiles( $files ) {
@@
-218,6
+216,11
@@
abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
}
protected function tearDown() {
}
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 ) {
$this->called['tearDown'] = true;
// Cleaning up temporary files
foreach ( $this->tmpFiles as $fileName ) {
@@
-233,9
+236,6
@@
abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
while ( $this->db->trxLevel() > 0 ) {
$this->db->rollback();
}
while ( $this->db->trxLevel() > 0 ) {
$this->db->rollback();
}
-
- // don't ignore DB errors
- $this->db->ignoreErrors( false );
}
// Restore mw globals
}
// Restore mw globals
@@
-1180,4
+1180,12
@@
abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
self::assertFalse( self::tagMatch( $matcher, $actual, $isHtml ), $message );
}
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;
+ }
}
}