Merge "wfMessage: use Message::params() to handle all the message parameters"
[lhc/web/wiklou.git] / tests / phpunit / includes / MessageTest.php
index 2d45c2e..1de9c23 100644 (file)
@@ -214,6 +214,14 @@ class MessageTest extends MediaWikiLangTestCase {
        public function testWfMessageParams() {
                $this->assertSame( 'Return to $1.', wfMessage( 'returnto' )->text() );
                $this->assertSame( 'Return to $1.', wfMessage( 'returnto', [] )->text() );
+               $this->assertSame(
+                       'Return to 1,024.',
+                       wfMessage( 'returnto', Message::numParam( 1024 ) )->text()
+               );
+               $this->assertSame(
+                       'Return to 1,024.',
+                       wfMessage( 'returnto', [ Message::numParam( 1024 ) ] )->text()
+               );
                $this->assertSame(
                        'You have foo (bar).',
                        wfMessage( 'youhavenewmessages', 'foo', 'bar' )->text()
@@ -222,6 +230,27 @@ class MessageTest extends MediaWikiLangTestCase {
                        'You have foo (bar).',
                        wfMessage( 'youhavenewmessages', [ 'foo', 'bar' ] )->text()
                );
+               $this->assertSame(
+                       'You have 1,024 (bar).',
+                       wfMessage(
+                               'youhavenewmessages',
+                               Message::numParam( 1024 ), 'bar'
+                       )->text()
+               );
+               $this->assertSame(
+                       'You have foo (2,048).',
+                       wfMessage(
+                               'youhavenewmessages',
+                               'foo', Message::numParam( 2048 )
+                       )->text()
+               );
+               $this->assertSame(
+                       'You have 1,024 (2,048).',
+                       wfMessage(
+                               'youhavenewmessages',
+                               [ Message::numParam( 1024 ), Message::numParam( 2048 ) ]
+                       )->text()
+               );
        }
 
        /**