3 class ParserOptionsTest
extends MediaWikiTestCase
{
9 ParserTest
::setUp(); //reuse setup from parser tests
10 global $wgContLang, $wgUser, $wgLanguageCode;
11 $wgContLang = Language
::factory( $wgLanguageCode );
12 $this->popts
= new ParserOptions( $wgUser );
13 $this->pcache
= ParserCache
::singleton();
21 * ParserOptions::optionsHash was not giving consistent results when $wgUseDynamicDates was set
24 function testGetParserCacheKeyWithDynamicDates() {
25 global $wgUseDynamicDates;
26 $wgUseDynamicDates = true;
28 $title = Title
::newFromText( "Some test article" );
29 $article = new Article( $title );
31 $pcacheKeyBefore = $this->pcache
->getKey( $article, $this->popts
);
32 $this->assertNotNull( $this->popts
->getDateFormat() );
33 $pcacheKeyAfter = $this->pcache
->getKey( $article, $this->popts
);
34 $this->assertEquals( $pcacheKeyBefore, $pcacheKeyAfter );