From: Alexandre Emsenhuber Date: Sun, 5 Feb 2012 16:45:41 +0000 (+0000) Subject: * Use WikiPage instead of Article for ParserCache stuff X-Git-Tag: 1.31.0-rc.0~24928 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=ba913a2eb057ccdca8d271dac0901da38d30a582;p=lhc%2Fweb%2Fwiklou.git * Use WikiPage instead of Article for ParserCache stuff * Use ParserOptions::newFromUserAndLang() instead of 'new ParserOptions' to not rely on global variables --- diff --git a/tests/phpunit/includes/ParserOptionsTest.php b/tests/phpunit/includes/ParserOptionsTest.php index 9c50cc408a..59c955fe89 100644 --- a/tests/phpunit/includes/ParserOptionsTest.php +++ b/tests/phpunit/includes/ParserOptionsTest.php @@ -8,7 +8,7 @@ class ParserOptionsTest extends MediaWikiTestCase { function setUp() { global $wgContLang, $wgUser, $wgLanguageCode; $wgContLang = Language::factory( $wgLanguageCode ); - $this->popts = new ParserOptions( $wgUser ); + $this->popts = ParserOptions::newFromUserAndLang( $wgUser, $wgContLang ); $this->pcache = ParserCache::singleton(); } @@ -25,11 +25,11 @@ class ParserOptionsTest extends MediaWikiTestCase { $wgUseDynamicDates = true; $title = Title::newFromText( "Some test article" ); - $article = new Article( $title ); + $page = WikiPage::factory( $title ); - $pcacheKeyBefore = $this->pcache->getKey( $article, $this->popts ); + $pcacheKeyBefore = $this->pcache->getKey( $page, $this->popts ); $this->assertNotNull( $this->popts->getDateFormat() ); - $pcacheKeyAfter = $this->pcache->getKey( $article, $this->popts ); + $pcacheKeyAfter = $this->pcache->getKey( $page, $this->popts ); $this->assertEquals( $pcacheKeyBefore, $pcacheKeyAfter ); } }