MediaWiki
REL1_22
|
00001 <?php 00002 00006 class ArticleTablesTest extends MediaWikiLangTestCase { 00007 00008 public function testbug14404() { 00009 global $wgContLang, $wgLanguageCode, $wgLang; 00010 00011 $title = Title::newFromText( 'Bug 14404' ); 00012 $page = WikiPage::factory( $title ); 00013 $user = new User(); 00014 $user->mRights = array( 'createpage', 'edit', 'purge' ); 00015 $wgLanguageCode = 'es'; 00016 $wgContLang = Language::factory( 'es' ); 00017 00018 $wgLang = Language::factory( 'fr' ); 00019 $page->doEditContent( new WikitextContent( '{{:{{int:history}}}}' ), 'Test code for bug 14404', 0, false, $user ); 00020 $templates1 = $title->getTemplateLinksFrom(); 00021 00022 $wgLang = Language::factory( 'de' ); 00023 $page = WikiPage::factory( $title ); // In order to force the rerendering of the same wikitext 00024 00025 // We need an edit, a purge is not enough to regenerate the tables 00026 $page->doEditContent( new WikitextContent( '{{:{{int:history}}}}' ), 'Test code for bug 14404', EDIT_UPDATE, false, $user ); 00027 $templates2 = $title->getTemplateLinksFrom(); 00028 00029 $this->assertEquals( $templates1, $templates2 ); 00030 $this->assertEquals( $templates1[0]->getFullText(), 'Historial' ); 00031 } 00032 }