3 class ParserOptionsTest
extends MediaWikiTestCase
{
8 protected function setUp() {
9 global $wgLanguageCode, $wgUser;
12 $langObj = Language
::factory( $wgLanguageCode );
14 $this->setMwGlobals( array(
15 'wgContLang' => $langObj,
16 'wgUseDynamicDates' => true,
19 $this->popts
= ParserOptions
::newFromUserAndLang( $wgUser, $langObj );
20 $this->pcache
= ParserCache
::singleton();
24 * ParserOptions::optionsHash was not giving consistent results when $wgUseDynamicDates was set
27 function testGetParserCacheKeyWithDynamicDates() {
28 $title = Title
::newFromText( "Some test article" );
29 $page = WikiPage
::factory( $title );
31 $pcacheKeyBefore = $this->pcache
->getKey( $page, $this->popts
);
32 $this->assertNotNull( $this->popts
->getDateFormat() );
34 $pcacheKeyAfter = $this->pcache
->getKey( $page, $this->popts
);
35 $this->assertEquals( $pcacheKeyBefore, $pcacheKeyAfter );