3 class ParserOptionsTest
extends MediaWikiTestCase
{
9 global $wgContLang, $wgUser, $wgLanguageCode;
10 $wgContLang = Language
::factory( $wgLanguageCode );
11 $this->popts
= ParserOptions
::newFromUserAndLang( $wgUser, $wgContLang );
12 $this->pcache
= ParserCache
::singleton();
20 * ParserOptions::optionsHash was not giving consistent results when $wgUseDynamicDates was set
23 function testGetParserCacheKeyWithDynamicDates() {
24 global $wgUseDynamicDates;
25 $wgUseDynamicDates = true;
27 $title = Title
::newFromText( "Some test article" );
28 $page = WikiPage
::factory( $title );
30 $pcacheKeyBefore = $this->pcache
->getKey( $page, $this->popts
);
31 $this->assertNotNull( $this->popts
->getDateFormat() );
32 $pcacheKeyAfter = $this->pcache
->getKey( $page, $this->popts
);
33 $this->assertEquals( $pcacheKeyBefore, $pcacheKeyAfter );