Allow aliased field names with separated syntax
[lhc/web/wiklou.git] / tests / phpunit / includes / ParserOptionsTest.php
1 <?php
2
3 class ParserOptionsTest extends MediaWikiTestCase {
4
5 private $popts;
6 private $pcache;
7
8 function setUp() {
9 global $wgContLang, $wgUser, $wgLanguageCode;
10 $wgContLang = Language::factory( $wgLanguageCode );
11 $this->popts = ParserOptions::newFromUserAndLang( $wgUser, $wgContLang );
12 $this->pcache = ParserCache::singleton();
13 }
14
15 function tearDown() {
16 parent::tearDown();
17 }
18
19 /**
20 * ParserOptions::optionsHash was not giving consistent results when $wgUseDynamicDates was set
21 * @group Database
22 */
23 function testGetParserCacheKeyWithDynamicDates() {
24 global $wgUseDynamicDates;
25 $wgUseDynamicDates = true;
26
27 $title = Title::newFromText( "Some test article" );
28 $page = WikiPage::factory( $title );
29
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 );
34 }
35 }