X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2FMediaWikiTestCase.php;h=4afe7105800c7afc00287dee2d553d7bf43b9611;hp=15833dc5357ea8f922aaff810cebbc74a15eafc7;hb=fb79f30319b9ad2a7eb0f5f4d1668143ec8f963e;hpb=230b3ee879e59109af175eb0b7eba0ef7cf7e160 diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 15833dc535..4afe710580 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -640,8 +640,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * The key is added to the array of globals that will be reset afterwards * in the tearDown(). * - * @example - * + * @par Example + * @code * protected function setUp() { * $this->setMwGlobals( 'wgRestrictStuff', true ); * } @@ -656,7 +656,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * } * * function testQuux() {} - * + * @endcode * * @param array|string $pairs Key to the global variable, or an array * of key/value pairs. @@ -1087,10 +1087,15 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { $page->doEditContent( new WikitextContent( 'UTContent' ), 'UTPageSummary', - EDIT_NEW, + EDIT_NEW | EDIT_SUPPRESS_RC, false, $user ); + // an edit always attempt to purge backlink links such as history + // pages. That is unneccessary. + JobQueueGroup::singleton()->get( 'htmlCacheUpdate' )->delete(); + // WikiPages::doEditUpdates randomly adds RC purges + JobQueueGroup::singleton()->get( 'recentChangesUpdate' )->delete(); // doEditContent() probably started the session via // User::loadFromSession(). Close it now. @@ -1485,7 +1490,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { ' method should return true. Use @group Database or $this->tablesUsed.' ); } - $db = wfGetDB( DB_SLAVE ); + $db = wfGetDB( DB_REPLICA ); $res = $db->select( $table, $fields, $condition, wfGetCaller(), [ 'ORDER BY' => $fields ] ); $this->assertNotEmpty( $res, "query failed: " . $db->lastError() );