MediaWiki  REL1_23
ArticleTablesTest.php
Go to the documentation of this file.
00001 <?php
00002 
00006 class ArticleTablesTest extends MediaWikiLangTestCase {
00007 
00013     public function testbug14404() {
00014         $title = Title::newFromText( 'Bug 14404' );
00015         $page = WikiPage::factory( $title );
00016         $user = new User();
00017         $user->mRights = array( 'createpage', 'edit', 'purge' );
00018         $this->setMwGlobals( 'wgLanguageCode', 'es' );
00019         $this->setMwGlobals( 'wgContLang', Language::factory( 'es' ) );
00020         $this->setMwGlobals( 'wgLang', Language::factory( 'fr' ) );
00021 
00022         $page->doEditContent(
00023             new WikitextContent( '{{:{{int:history}}}}' ),
00024             'Test code for bug 14404',
00025             0,
00026             false,
00027             $user
00028         );
00029         $templates1 = $title->getTemplateLinksFrom();
00030 
00031         $this->setMwGlobals( 'wgLang', Language::factory( 'de' ) );
00032         $page = WikiPage::factory( $title ); // In order to force the re-rendering of the same wikitext
00033 
00034         // We need an edit, a purge is not enough to regenerate the tables
00035         $page->doEditContent(
00036             new WikitextContent( '{{:{{int:history}}}}' ),
00037             'Test code for bug 14404',
00038             EDIT_UPDATE,
00039             false,
00040             $user
00041         );
00042         $templates2 = $title->getTemplateLinksFrom();
00043 
00048         $this->assertEquals( $templates1, $templates2 );
00049         $this->assertEquals( $templates1[0]->getFullText(), 'Historial' );
00050     }
00051 }