* Call Linker methods statically
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 5 Aug 2011 15:17:19 +0000 (15:17 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 5 Aug 2011 15:17:19 +0000 (15:17 +0000)
* Use INSERT IGNORE for the site_stats row (as for the interwiki entries); was throwing query error about duplicate row on my installation

tests/parser/parserTest.inc
tests/phpunit/includes/parser/NewParserTest.php

index 9b8dcaa..ea96c68 100644 (file)
@@ -452,8 +452,7 @@ class ParserTest {
                        $replace = $opts['replace'][1];
                        $out = $parser->replaceSection( $input, $section, $replace );
                } elseif ( isset( $opts['comment'] ) ) {
-                       $linker = $user->getSkin();
-                       $out = $linker->formatComment( $input, $title, $local );
+                       $out = Linker::formatComment( $input, $title, $local );
                } elseif ( isset( $opts['preload'] ) ) {
                        $out = $parser->getpreloadText( $input, $title, $options );
                } else {
index a4da039..6c986c2 100644 (file)
@@ -164,7 +164,7 @@ class NewParserTest extends MediaWikiTestCase {
                # Update certain things in site_stats
                $this->db->insert( 'site_stats',
                        array( 'ss_row_id' => 1, 'ss_images' => 2, 'ss_good_articles' => 1 ),
-                       __METHOD__ );
+                       __METHOD__, array( 'IGNORE' ) );
 
                # Reinitialise the LocalisationCache to match the database state
                Language::getLocalisationCache()->unloadAll();
@@ -500,8 +500,7 @@ class NewParserTest extends MediaWikiTestCase {
                        $replace = $opts['replace'][1];
                        $out = $parser->replaceSection( $input, $section, $replace );
                } elseif ( isset( $opts['comment'] ) ) {
-                       $linker = $user->getSkin();
-                       $out = $linker->formatComment( $input, $title, $local );
+                       $out = Linker::formatComment( $input, $title, $local );
                } elseif ( isset( $opts['preload'] ) ) {
                        $out = $parser->getpreloadText( $input, $title, $options );
                } else {