'ConfigFactory',
self::makeTestConfigFactoryInstantiator(
$oldConfigFactory,
- [ 'main' => $bootstrapConfig ]
+ [ 'main' => $bootstrapConfig ]
)
);
$newServices->resetServiceForTesting( 'DBLoadBalancerFactory' );
$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 Database[] Array of Database master connections
*/
-
protected static function getExternalStoreDatabaseConnections() {
global $wgDefaultExternalStore;
' 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() );
$this->mergeMwGlobalArrayValue( 'wgHooks', [ $hookName => [ $handler ] ] );
}
+ /**
+ * Check whether file contains given data.
+ * @param string $fileName
+ * @param string $actualData
+ * @param bool $createIfMissing If true, and file does not exist, create it with given data
+ * and skip the test.
+ * @param string $msg
+ * @since 1.30
+ */
+ protected function assertFileContains(
+ $fileName,
+ $actualData,
+ $createIfMissing = true,
+ $msg = ''
+ ) {
+ if ( $createIfMissing ) {
+ if ( !file_exists( $fileName ) ) {
+ file_put_contents( $fileName, $actualData );
+ $this->markTestSkipped( 'Data file $fileName does not exist' );
+ }
+ } else {
+ self::assertFileExists( $fileName );
+ }
+ self::assertEquals( file_get_contents( $fileName ), $actualData, $msg );
+ }
}