Merge "Update links for software homepages"
[lhc/web/wiklou.git] / tests / phpunit / includes / MessageTest.php
index 25b0805..6a36b4b 100644 (file)
@@ -119,12 +119,16 @@ class MessageTest extends MediaWikiLangTestCase {
         */
        public function testInLanguage() {
                $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inLanguage( 'en' )->text() );
-               $this->assertEquals( 'Заглавная страница', wfMessage( 'mainpage' )->inLanguage( 'ru' )->text() );
+               $this->assertEquals( 'Заглавная страница',
+                       wfMessage( 'mainpage' )->inLanguage( 'ru' )->text() );
 
                // NOTE: make sure internal caching of the message text is reset appropriately
                $msg = wfMessage( 'mainpage' );
                $this->assertEquals( 'Main Page', $msg->inLanguage( Language::factory( 'en' ) )->text() );
-               $this->assertEquals( 'Заглавная страница', $msg->inLanguage( Language::factory( 'ru' ) )->text() );
+               $this->assertEquals(
+                       'Заглавная страница',
+                       $msg->inLanguage( Language::factory( 'ru' ) )->text()
+               );
        }
 
        /**
@@ -133,8 +137,14 @@ class MessageTest extends MediaWikiLangTestCase {
        public 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() );
+               $this->assertEquals(
+                       'You have foo (bar).',
+                       wfMessage( 'youhavenewmessages', 'foo', 'bar' )->text()
+               );
+               $this->assertEquals(
+                       'You have foo (bar).',
+                       wfMessage( 'youhavenewmessages', array( 'foo', 'bar' ) )->text()
+               );
        }
 
        /**
@@ -142,10 +152,22 @@ class MessageTest extends MediaWikiLangTestCase {
         * @covers Message::rawParams
         */
        public 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() );
+               $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()
+               );
        }
 
        /**
@@ -156,7 +178,11 @@ class MessageTest extends MediaWikiLangTestCase {
                $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' );
+               $this->assertEquals(
+                       'abcdefghijka2',
+                       $msg->params( $params )->plain(),
+                       'Params > 9 are replaced correctly'
+               );
        }
 
        /**
@@ -270,9 +296,17 @@ class MessageTest extends MediaWikiLangTestCase {
                // NOTE: make sure internal caching of the message text is reset appropriately.
                // NOTE: wgForceUIMsgAsContentMsg forces the messages *current* language to be used.
                $msg = wfMessage( 'mainpage' );
-               $this->assertEquals( 'Accueil', $msg->inContentLanguage()->plain(), 'inContentLanguage() with ForceUIMsg override enabled' );
+               $this->assertEquals(
+                       'Accueil',
+                       $msg->inContentLanguage()->plain(),
+                       'inContentLanguage() with ForceUIMsg override enabled'
+               );
                $this->assertEquals( 'Main Page', $msg->inLanguage( 'en' )->plain(), "inLanguage( 'en' )" );
-               $this->assertEquals( 'Main Page', $msg->inContentLanguage()->plain(), 'inContentLanguage() with ForceUIMsg override enabled' );
+               $this->assertEquals(
+                       'Main Page',
+                       $msg->inContentLanguage()->plain(),
+                       'inContentLanguage() with ForceUIMsg override enabled'
+               );
                $this->assertEquals( 'Hauptseite', $msg->inLanguage( 'de' )->plain(), "inLanguage( 'de' )" );
        }