r79121 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79120‎ | r79121 | r79122 >
Date:18:43, 28 December 2010
Author:platonides
Status:ok
Tags:
Comment:
Add failing test for bug 14404.
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/ArticleTablesTest.php (added) (history)

Diff [purge]

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

Follow-up revisions

RevisionCommit summaryAuthorDate
r79122Fix bug 14404. The articles are now always saved with the default options....platonides18:44, 28 December 2010
r89706Reinstate r79122 (fix for bug 14404), reverting r83868. The real bug seem to ...platonides22:28, 7 June 2011
r97206Follow up r89706, building up on r97091....platonides21:09, 15 September 2011

Status & tagging log