r81882 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81881‎ | r81882 | r81883 >
Date:10:10, 10 February 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Tests for r81878
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/MessageTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/MessageTest.php
@@ -34,13 +34,21 @@
3535 $this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( Language::factory( 'ru' ) )->text() );
3636 }
3737
38 - function testMessagePararms() {
 38+ function testMessageParams() {
3939 $this->assertEquals( 'Return to $1.', wfMessage( 'returnto' )->text() );
4040 $this->assertEquals( 'Return to $1.', wfMessage( 'returnto', array() )->text() );
4141 $this->assertEquals( 'You have foo (bar).', wfMessage( 'youhavenewmessages', 'foo', 'bar' )->text() );
4242 $this->assertEquals( 'You have foo (bar).', wfMessage( 'youhavenewmessages', array( 'foo', 'bar' ) )->text() );
4343 }
4444
 45+ function testMessageParamSubstitution() {
 46+ $this->assertEquals( '(Заглавная страница)', wfMessage( 'parentheses', 'Заглавная страница' )->plain() );
 47+ $this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses', 'Заглавная страница $1' )->plain() );
 48+ $this->assertEquals( '(Заглавная страница)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница' )->plain() );
 49+ $this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница $1' )->plain() );
 50+
 51+ }
 52+
4553 /**
4654 * @expectedException MWException
4755 */

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81878Fixed two bugs in message parameter handling:...nikerabbit09:10, 10 February 2011

Status & tagging log