Added merge() function to BagOStuff for CAS-like functionality.
[mediawiki.git] / tests / phpunit / includes / ParserOptionsTest.php
blob5b2adaf9fd40ea95c01344a2bd9190841891f508
1 <?php
3 class ParserOptionsTest extends MediaWikiTestCase {
5 private $popts;
6 private $pcache;
8 protected function setUp() {
9 global $wgLanguageCode, $wgUser;
10 parent::setUp();
12 $langObj = Language::factory( $wgLanguageCode );
14 $this->setMwGlobals( array(
15 'wgContLang' => $langObj,
16 'wgUseDynamicDates' => true,
17 ) );
19 $this->popts = ParserOptions::newFromUserAndLang( $wgUser, $langObj );
20 $this->pcache = ParserCache::singleton();
23 /**
24 * ParserOptions::optionsHash was not giving consistent results when $wgUseDynamicDates was set
25 * @group Database
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 );