From: Aaron Schulz Date: Wed, 2 Dec 2015 00:13:51 +0000 (-0800) Subject: Remove DeferredUpdates::forceDeferral() testing hack X-Git-Tag: 1.31.0-rc.0~8804 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=d2c33200f77aa72996e081041ebcf533f42bd733;p=lhc%2Fweb%2Fwiklou.git Remove DeferredUpdates::forceDeferral() testing hack Change-Id: I7f2ad8190e1a746b6c39190b86fa9c83c5b921fe --- diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php index adad908e36..fb6ef13f5b 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -42,9 +42,6 @@ class DeferredUpdates { /** @var DeferrableUpdate[] Updates to be deferred until after request end */ private static $postSendUpdates = array(); - /** @var bool Defer updates fully even in CLI mode */ - private static $forceDeferral = false; - const ALL = 0; // all updates const PRESEND = 1; // for updates that should run before flushing output buffer const POSTSEND = 2; // for updates that should run after flushing output buffer @@ -108,10 +105,6 @@ class DeferredUpdates { $queue[] = $update; } - if ( self::$forceDeferral ) { - return; // do not run - } - // CLI scripts may forget to periodically flush these updates, // so try to handle that rather than OOMing and losing them entirely. // Try to run the updates as soon as there is no current wiki transaction. @@ -181,13 +174,4 @@ class DeferredUpdates { self::$preSendUpdates = array(); self::$postSendUpdates = array(); } - - /** - * @note This method is intended for testing purposes - * @param bool $value Whether to *always* defer updates, even in CLI mode - * @since 1.27 - */ - public static function forceDeferral( $value ) { - self::$forceDeferral = $value; - } } diff --git a/tests/phpunit/includes/filebackend/FileBackendTest.php b/tests/phpunit/includes/filebackend/FileBackendTest.php index 9bef8e0577..94e6231d7a 100644 --- a/tests/phpunit/includes/filebackend/FileBackendTest.php +++ b/tests/phpunit/includes/filebackend/FileBackendTest.php @@ -80,11 +80,6 @@ class FileBackendTest extends MediaWikiTestCase { ) ); } - protected function tearDown() { - parent::tearDown(); - DeferredUpdates::forceDeferral( false ); - } - private static function baseStorePath() { return 'mwstore://localtesting'; } @@ -2504,7 +2499,7 @@ class FileBackendTest extends MediaWikiTestCase { ) ) ); - DeferredUpdates::forceDeferral( true ); + $this->setMwGlobals( 'wgCommandLineMode', false ); $p = 'container/test-cont/file.txt'; $be->quickCreate( array( @@ -2522,7 +2517,6 @@ class FileBackendTest extends MediaWikiTestCase { ); DeferredUpdates::doUpdates(); - DeferredUpdates::forceDeferral( false ); $this->assertEquals( 'cattitude',