r110723 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110722‎ | r110723 | r110724 >
Date:16:45, 5 February 2012
Author:ialex
Status:ok
Tags:
Comment:
* Use WikiPage instead of Article for ParserCache stuff
* Use ParserOptions::newFromUserAndLang() instead of 'new ParserOptions' to not rely on global variables
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/ParserOptionsTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/ParserOptionsTest.php
@@ -8,7 +8,7 @@
99 function setUp() {
1010 global $wgContLang, $wgUser, $wgLanguageCode;
1111 $wgContLang = Language::factory( $wgLanguageCode );
12 - $this->popts = new ParserOptions( $wgUser );
 12+ $this->popts = ParserOptions::newFromUserAndLang( $wgUser, $wgContLang );
1313 $this->pcache = ParserCache::singleton();
1414 }
1515
@@ -25,11 +25,11 @@
2626 $wgUseDynamicDates = true;
2727
2828 $title = Title::newFromText( "Some test article" );
29 - $article = new Article( $title );
 29+ $page = WikiPage::factory( $title );
3030
31 - $pcacheKeyBefore = $this->pcache->getKey( $article, $this->popts );
 31+ $pcacheKeyBefore = $this->pcache->getKey( $page, $this->popts );
3232 $this->assertNotNull( $this->popts->getDateFormat() );
33 - $pcacheKeyAfter = $this->pcache->getKey( $article, $this->popts );
 33+ $pcacheKeyAfter = $this->pcache->getKey( $page, $this->popts );
3434 $this->assertEquals( $pcacheKeyBefore, $pcacheKeyAfter );
3535 }
3636 }

Status & tagging log