From 98345b9738f121659d2365ca9e2261dffb4a3a89 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Wed, 2 Jan 2013 17:06:23 +0000 Subject: [PATCH] Add test for substitution of params with multiple digits Change-Id: I293bcdeecd5ee83cf05887aa06dc86b5589398eb --- tests/phpunit/includes/MessageTest.php | 7 +++++++ 1 file changed, 7 insertions(+) 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' ); -- 2.20.1