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