Merge "parserTests.php: fix three bitrot bugs with --record"
[lhc/web/wiklou.git] / tests / parser / parserTest.inc
index c10d3f7..78e5f6f 100644 (file)
@@ -195,7 +195,7 @@ class ParserTest {
                        'transformVia404' => false,
                        'backend' => new FSFileBackend( [
                                'name' => 'local-backend',
-                               'wikiId' => wfWikiId(),
+                               'wikiId' => wfWikiID(),
                                'containerPaths' => [
                                        'local-public' => $this->uploadDir . '/public',
                                        'local-thumb' => $this->uploadDir . '/thumb',
@@ -244,6 +244,10 @@ class ParserTest {
                // "extra language links"
                // see https://gerrit.wikimedia.org/r/111390
                array_push( $wgExtraInterlanguageLinkPrefixes, 'mul' );
+
+               // Reset namespace cache
+               MWNamespace::getCanonicalNamespaces( true );
+               Language::factory( 'en' )->resetNamespaces();
        }
 
        /**
@@ -536,7 +540,7 @@ class ParserTest {
                        $result =
                                $this->runTest( $t['test'], $t['input'], $t['result'], $t['options'], $t['config'] );
                        $ok = $ok && $result;
-                       $this->recorder->record( $t['test'], $result );
+                       $this->recorder->record( $t['test'], $t['subtest'], $result );
                }
 
                if ( $this->showProgress ) {
@@ -619,6 +623,7 @@ class ParserTest {
                        $titleText = 'Parser test';
                }
 
+               ObjectCache::getMainWANInstance()->clearProcessCache();
                $local = isset( $opts['local'] );
                $preprocessor = isset( $opts['preprocessor'] ) ? $opts['preprocessor'] : null;
                $parser = $this->getParser( $preprocessor );
@@ -849,7 +854,7 @@ class ParserTest {
                                'transformVia404' => false,
                                'backend' => new FSFileBackend( [
                                        'name' => 'local-backend',
-                                       'wikiId' => wfWikiId(),
+                                       'wikiId' => wfWikiID(),
                                        'containerPaths' => [
                                                'local-public' => $this->uploadDir,
                                                'local-thumb' => $this->uploadDir . '/thumb',