From: Niklas Laxström Date: Wed, 2 Jan 2013 17:06:23 +0000 (+0000) Subject: Add test for substitution of params with multiple digits X-Git-Tag: 1.31.0-rc.0~21167 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=98345b9738f121659d2365ca9e2261dffb4a3a89;p=lhc%2Fweb%2Fwiklou.git Add test for substitution of params with multiple digits Change-Id: I293bcdeecd5ee83cf05887aa06dc86b5589398eb --- diff --git a/tests/phpunit/includes/MessageTest.php b/tests/phpunit/includes/MessageTest.php index 22450dc431..c378bb8ed3 100644 --- a/tests/phpunit/includes/MessageTest.php +++ b/tests/phpunit/includes/MessageTest.php @@ -49,6 +49,13 @@ class MessageTest extends MediaWikiLangTestCase { $this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница $1' )->plain() ); } + function testDeliciouslyManyParams() { + $msg = new RawMessage( '$1$2$3$4$5$6$7$8$9$10$11$12' ); + // One less than above has placeholders + $params = array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k' ); + $this->assertEquals( 'abcdefghijka2', $msg->params( $params )->plain(), 'Params > 9 are replaced correctly' ); + } + function testInContentLanguage() { global $wgLang, $wgForceUIMsgAsContentMsg; $wgLang = Language::factory( 'fr' );