3 class ParserOptionsTest
extends PHPUnit_Framework_TestCase
{
9 ParserTest
::setUp(); //reuse setup from parser tests
10 global $wgContLang, $wgUser;
11 $wgContLang = new StubContLang
;
12 $this->popts
= new ParserOptions( $wgUser );
13 $this->pcache
= ParserCache
::singleton();
21 * 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 $article = new Article( $title );
30 $pcacheKeyBefore = $this->pcache
->getKey( $article, $this->popts
);
31 $this->assertNotNull( $this->popts
->getDateFormat() );
32 $pcacheKeyAfter = $this->pcache
->getKey( $article, $this->popts
);
33 $this->assertEquals( $pcacheKeyBefore, $pcacheKeyAfter );