Many more function case mismatches
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / NewParserTest.php
index 895398f..b0c1525 100644 (file)
@@ -71,13 +71,14 @@ class NewParserTest extends MediaWikiTestCase {
                $tmpGlobals['wgSitename'] = 'MediaWiki';
                $tmpGlobals['wgServer'] = 'http://example.org';
                $tmpGlobals['wgServerName'] = 'example.org';
+               $tmpGlobals['wgScriptPath'] = '';
                $tmpGlobals['wgScript'] = '/index.php';
-               $tmpGlobals['wgScriptPath'] = '/';
+               $tmpGlobals['wgResourceBasePath'] = '';
+               $tmpGlobals['wgStylePath'] = '/skins';
+               $tmpGlobals['wgExtensionAssetsPath'] = '/extensions';
                $tmpGlobals['wgArticlePath'] = '/wiki/$1';
                $tmpGlobals['wgActionPaths'] = [];
                $tmpGlobals['wgVariantArticlePath'] = false;
-               $tmpGlobals['wgExtensionAssetsPath'] = '/extensions';
-               $tmpGlobals['wgStylePath'] = '/skins';
                $tmpGlobals['wgEnableUploads'] = true;
                $tmpGlobals['wgUploadNavigationUrl'] = false;
                $tmpGlobals['wgThumbnailScriptPath'] = false;
@@ -101,7 +102,6 @@ class NewParserTest extends MediaWikiTestCase {
                $tmpGlobals['wgAllowExternalImages'] = true;
                $tmpGlobals['wgRawHtml'] = false;
                $tmpGlobals['wgWellFormedXml'] = true;
-               $tmpGlobals['wgAllowMicrodataAttributes'] = true;
                $tmpGlobals['wgExperimentalHtmlIds'] = false;
                $tmpGlobals['wgAdaptiveMessageCache'] = true;
                $tmpGlobals['wgUseDatabaseMessages'] = true;
@@ -142,6 +142,9 @@ class NewParserTest extends MediaWikiTestCase {
                // DjVu images have to be handled slightly differently
                $tmpGlobals['wgMediaHandlers']['image/vnd.djvu'] = 'MockDjVuHandler';
 
+               // Ogg video/audio increasingly more differently
+               $tmpGlobals['wgMediaHandlers']['application/ogg'] = 'MockOggHandler';
+
                $tmpHooks = $wgHooks;
                $tmpHooks['ParserTestParser'][] = 'ParserTestParserHook::setup';
                $tmpHooks['ParserGetVariableValueTs'][] = 'ParserTest::getFakeTimestamp';
@@ -207,15 +210,15 @@ class NewParserTest extends MediaWikiTestCase {
                parent::tearDownAfterClass();
        }
 
-       function addDBData() {
-               $this->tablesUsed[] = 'site_stats';
+       function addDBDataOnce() {
                # disabled for performance
                # $this->tablesUsed[] = 'image';
 
                # Update certain things in site_stats
                $this->db->insert( 'site_stats',
                        [ 'ss_row_id' => 1, 'ss_images' => 2, 'ss_good_articles' => 1 ],
-                       __METHOD__
+                       __METHOD__,
+                       [ 'IGNORE' ]
                );
 
                $user = User::newFromId( 0 );
@@ -308,13 +311,13 @@ class NewParserTest extends MediaWikiTestCase {
                if ( !$this->db->selectField( 'image', '1', [ 'img_name' => $image->getName() ] ) ) {
                        $image->recordUpload2( '', 'A pretty movie', 'Will it play', [
                                        'size'        => 12345,
-                                       'width'       => 240,
-                                       'height'      => 180,
+                                       'width'       => 320,
+                                       'height'      => 240,
                                        'bits'        => 0,
                                        'media_type'  => MEDIATYPE_VIDEO,
                                        'mime'        => 'application/ogg',
                                        'metadata'    => serialize( [] ),
-                                       'sha1'        => Wikimedia\base_convert( '', 16, 36, 31 ),
+                                       'sha1'        => Wikimedia\base_convert( '', 16, 36, 32 ),
                                        'fileExists'  => true
                        ], $this->db->timestamp( '20010115123500' ), $user );
                }
@@ -408,7 +411,7 @@ class NewParserTest extends MediaWikiTestCase {
                        # informations.
                        $backend = new MockFileBackend( [
                                'name' => 'local-backend',
-                               'wikiId' => wfWikiId()
+                               'wikiId' => wfWikiID()
                        ] );
                }