Tests for r81878
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 10 Feb 2011 10:10:44 +0000 (10:10 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 10 Feb 2011 10:10:44 +0000 (10:10 +0000)
tests/phpunit/includes/MessageTest.php

index 2e13d22..c562611 100644 (file)
@@ -34,13 +34,21 @@ class MessageTest extends MediaWikiTestCase {
                $this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( Language::factory( 'ru' ) )->text() );
        }
 
-       function testMessagePararms() {
+       function testMessageParams() {
                $this->assertEquals( 'Return to $1.', wfMessage( 'returnto' )->text() );
                $this->assertEquals( 'Return to $1.', wfMessage( 'returnto', array() )->text() );
                $this->assertEquals( 'You have foo (bar).', wfMessage( 'youhavenewmessages', 'foo', 'bar' )->text() );
                $this->assertEquals( 'You have foo (bar).', wfMessage( 'youhavenewmessages', array( 'foo', 'bar' ) )->text() );
        }
 
+       function testMessageParamSubstitution() {
+               $this->assertEquals( '(Заглавная страница)', wfMessage( 'parentheses', 'Заглавная страница' )->plain() );
+               $this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses', 'Заглавная страница $1' )->plain() );
+               $this->assertEquals( '(Заглавная страница)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница' )->plain() );
+               $this->assertEquals( '(Заглавная страница $1)', wfMessage( 'parentheses' )->rawParams( 'Заглавная страница $1' )->plain() );
+
+       }
+
        /**
         * @expectedException MWException
         */