use MediaWiki\Logger\MonologSpi;
use MediaWiki\MediaWikiServices;
use Psr\Log\LoggerInterface;
+use Wikimedia\Rdbms\IMaintainableDatabase;
+use Wikimedia\Rdbms\Database;
use Wikimedia\TestingAccessWrapper;
/**
* The key is added to the array of globals that will be reset afterwards
* in the tearDown().
*
- * @example
- * <code>
+ * @par Example
+ * @code
* protected function setUp() {
* $this->setMwGlobals( 'wgRestrictStuff', true );
* }
* }
*
* function testQuux() {}
- * </code>
+ * @endcode
*
* @param array|string $pairs Key to the global variable, or an array
* of key/value pairs.
$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.
return;
}
+ Hooks::run( 'UnitTestsBeforeDatabaseTeardown' );
+
foreach ( $wgJobClasses as $type => $class ) {
// Delete any jobs under the clone DB (or old prefix in other stores)
JobQueueGroup::singleton()->get( $type )->delete();
if ( $db->getType() == 'oracle' ) {
$db->query( 'BEGIN FILL_WIKI_INFO; END;' );
}
+
+ Hooks::run( 'UnitTestsAfterDatabaseSetup', [ $db, $prefix ] );
}
/**