Merge "resourceloader: Re-enable testGetBlobCached() test case"
[lhc/web/wiklou.git] / tests / phpunit / includes / RevisionDbTestBase.php
index 5de34d1..ba1249a 100644 (file)
@@ -43,9 +43,21 @@ abstract class RevisionDbTestBase extends MediaWikiTestCase {
                );
        }
 
+       /**
+        * @return int
+        */
+       abstract protected function getMcrMigrationStage();
+
+       /**
+        * @return string[]
+        */
+       abstract protected function getMcrTablesToReset();
+
        protected function setUp() {
                global $wgContLang;
 
+               $this->tablesUsed += $this->getMcrTablesToReset();
+
                parent::setUp();
 
                $this->mergeMwGlobalArrayValue(
@@ -72,11 +84,17 @@ abstract class RevisionDbTestBase extends MediaWikiTestCase {
                );
 
                $this->setMwGlobals( 'wgContentHandlerUseDB', $this->getContentHandlerUseDB() );
+               $this->setMwGlobals(
+                       'wgMultiContentRevisionSchemaMigrationStage',
+                       $this->getMcrMigrationStage()
+               );
 
                MWNamespace::clearCaches();
                // Reset namespace cache
                $wgContLang->resetNamespaces();
 
+               $this->overrideMwServices();
+
                if ( !$this->testPage ) {
                        /**
                         * We have to create a new page for each subclass as the page creation may result
@@ -1346,6 +1364,7 @@ abstract class RevisionDbTestBase extends MediaWikiTestCase {
         */
        public function testNewKnownCurrent() {
                // Setup the services
+               $this->resetGlobalServices();
                $cache = new WANObjectCache( [ 'cache' => new HashBagOStuff() ] );
                $this->setService( 'MainWANObjectCache', $cache );
                $db = wfGetDB( DB_MASTER );