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