From 762c3f820465c4083eeb5a08b53df2bb8a2ace69 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 5 Aug 2011 15:17:19 +0000 Subject: [PATCH] * Call Linker methods statically * 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 | 3 +-- tests/phpunit/includes/parser/NewParserTest.php | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index 9b8dcaa485..ea96c68df3 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -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 { diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php index a4da0393a4..6c986c2278 100644 --- a/tests/phpunit/includes/parser/NewParserTest.php +++ b/tests/phpunit/includes/parser/NewParserTest.php @@ -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 { -- 2.20.1