use HashBagOStuff;
use Language;
+use MediaWiki\MediaWikiServices;
use MediaWiki\Storage\RevisionAccessException;
use MediaWiki\Storage\RevisionStore;
use MediaWiki\Storage\SqlBlobStore;
return new RevisionStore(
$loadBalancer ? $loadBalancer : $this->getMockLoadBalancer(),
$blobStore ? $blobStore : $this->getMockSqlBlobStore(),
- $WANObjectCache ? $WANObjectCache : $this->getHashWANObjectCache()
+ $WANObjectCache ? $WANObjectCache : $this->getHashWANObjectCache(),
+ MediaWikiServices::getInstance()->getCommentStore()
);
}
* @covers \MediaWiki\Storage\RevisionStore::getQueryInfo
*/
public function testGetQueryInfo( $contentHandlerUseDb, $options, $expected ) {
+ $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD );
+ $this->overrideMwServices();
$store = $this->getRevisionStore();
$store->setContentHandlerUseDB( $contentHandlerUseDb );
- $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD );
$this->assertEquals( $expected, $store->getQueryInfo( $options ) );
}
* @covers \MediaWiki\Storage\RevisionStore::getArchiveQueryInfo
*/
public function testGetArchiveQueryInfo_contentHandlerDb() {
+ $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD );
+ $this->overrideMwServices();
$store = $this->getRevisionStore();
$store->setContentHandlerUseDB( true );
- $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD );
$this->assertEquals(
[
'tables' => [
* @covers \MediaWiki\Storage\RevisionStore::getArchiveQueryInfo
*/
public function testGetArchiveQueryInfo_noContentHandlerDb() {
+ $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD );
+ $this->overrideMwServices();
$store = $this->getRevisionStore();
$store->setContentHandlerUseDB( false );
- $this->setMwGlobals( 'wgCommentTableSchemaMigrationStage', MIGRATION_OLD );
$this->assertEquals(
[
'tables' => [
$blobStore = new SqlBlobStore( wfGetLB(), $cache );
$blobStore->setLegacyEncoding( $encoding, Language::factory( $locale ) );
- $store = new RevisionStore( wfGetLB(), $blobStore, $cache );
+ $store = $this->getRevisionStore( wfGetLB(), $blobStore, $cache );
$record = $store->newRevisionFromRow(
$this->makeRow( $row ),
$blobStore = new SqlBlobStore( wfGetLB(), $cache );
$blobStore->setLegacyEncoding( 'windows-1252', Language::factory( 'en' ) );
- $store = new RevisionStore( wfGetLB(), $blobStore, $cache );
+ $store = $this->getRevisionStore( wfGetLB(), $blobStore, $cache );
$record = $store->newRevisionFromRow(
$this->makeRow( $row ),