7 class ArticleTablesTest
extends MediaWikiTestCase
{
10 global $wgLanguageCode;
12 $this->languageCode
= $wgLanguageCode;
16 global $wgLanguageCode, $wgContLang, $wgLang;
17 $wgLanguageCode = $this->languageCode
;
18 $wgContLang = new StubContLang
;
19 $wgLang = new StubUserLang
;
22 function testbug14404() {
23 global $wgUser, $wgContLang, $wgLanguageCode, $wgLang;
25 $title = Title
::newFromText("Bug 14404");
26 $article = new Article( $title );
28 $wgUser->mRights
= array( 'createpage', 'edit', 'purge' );
29 $wgLanguageCode = 'es';
30 $wgContLang = Language
::factory( 'es' );
32 $wgLang = Language
::factory( 'fr' );
33 $status = $article->doEdit( '{{:{{int:history}}}}', 'Test code for bug 14404', 0 );
34 $templates1 = $article->getUsedTemplates();
36 $wgLang = Language
::factory( 'de' );
37 $article->mParserOptions
= null; // Let it pick the new user language
38 $article->mPreparedEdit
= false; // In order to force the rerendering of the same wikitext
40 // We need an edit, a purge is not enough to regenerate the tables
41 $status = $article->doEdit( '{{:{{int:history}}}}', 'Test code for bug 14404', EDIT_UPDATE
);
42 $templates2 = $article->getUsedTemplates();
44 $this->assertEquals( $templates1, $templates2 );
45 $this->assertEquals( $templates1[0]->getFullText(), 'Historial' );