MediaWiki  REL1_19
ParserOptionsTest.php
Go to the documentation of this file.
00001 <?php
00002 
00003 class ParserOptionsTest extends MediaWikiTestCase {
00004 
00005         private $popts;
00006         private $pcache;
00007 
00008         function setUp() {
00009                 global $wgContLang, $wgUser, $wgLanguageCode;
00010                 $wgContLang = Language::factory( $wgLanguageCode );
00011                 $this->popts = ParserOptions::newFromUserAndLang( $wgUser, $wgContLang );
00012                 $this->pcache = ParserCache::singleton();
00013         }
00014 
00015         function tearDown() {
00016                 parent::tearDown();
00017         }
00018 
00023         function testGetParserCacheKeyWithDynamicDates() {
00024                 global $wgUseDynamicDates;
00025                 $wgUseDynamicDates = true;
00026 
00027                 $title = Title::newFromText( "Some test article" );
00028                 $page = WikiPage::factory( $title );
00029 
00030                 $pcacheKeyBefore = $this->pcache->getKey( $page, $this->popts );
00031                 $this->assertNotNull( $this->popts->getDateFormat() );
00032                 $pcacheKeyAfter = $this->pcache->getKey( $page, $this->popts );
00033                 $this->assertEquals( $pcacheKeyBefore, $pcacheKeyAfter );
00034         }
00035 }