Follow up r87210
[lhc/web/wiklou.git] / tests / phpunit / includes / ArticleTablesTest.php
1 <?php
2
3 /**
4 * @group Database
5 * @group Destructive
6 */
7 class ArticleTablesTest extends MediaWikiLangTestCase {
8 /**
9 * @group Broken
10 */
11 function testbug14404() {
12 global $wgUser, $wgContLang, $wgLanguageCode, $wgLang;
13
14 $title = Title::newFromText("Bug 14404");
15 $article = new Article( $title );
16 $wgUser = new User();
17 $wgUser->mRights = array( 'createpage', 'edit', 'purge' );
18 $wgLanguageCode = 'es';
19 $wgContLang = Language::factory( 'es' );
20
21 $wgLang = Language::factory( 'fr' );
22 $status = $article->doEdit( '{{:{{int:history}}}}', 'Test code for bug 14404', 0 );
23 $templates1 = $article->getUsedTemplates();
24
25 $wgLang = Language::factory( 'de' );
26 $article->mParserOptions = null; // Let it pick the new user language
27 $article->mPreparedEdit = false; // In order to force the rerendering of the same wikitext
28
29 // We need an edit, a purge is not enough to regenerate the tables
30 $status = $article->doEdit( '{{:{{int:history}}}}', 'Test code for bug 14404', EDIT_UPDATE );
31 $templates2 = $article->getUsedTemplates();
32
33 $this->assertEquals( $templates1, $templates2 );
34 $this->assertEquals( $templates1[0]->getFullText(), 'Historial' );
35 }
36
37 }