Bartosz Dziewoński has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/163844

Change subject: DiscussionParser: More tests for custom and localised namespaces
......................................................................

DiscussionParser: More tests for custom and localised namespaces

Change-Id: Iebd60aab83b0a5695b2a006f0e723e127302c35a
---
M tests/phpunit/includes/DiscussionParserTest.php
1 file changed, 42 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/44/163844/1

diff --git a/tests/phpunit/includes/DiscussionParserTest.php 
b/tests/phpunit/includes/DiscussionParserTest.php
index d068519..50b4f0a 100644
--- a/tests/phpunit/includes/DiscussionParserTest.php
+++ b/tests/phpunit/includes/DiscussionParserTest.php
@@ -3,7 +3,7 @@
 /**
  * @group Echo
  */
-class EchoDiscussionParserTest extends MediaWikiTestCase {
+class EchoDiscussionParserTest extends MediaWikiLangTestCase {
        // TODO test cases for:
        // - generateEventsForRevision
        // - stripHeader
@@ -60,6 +60,15 @@
         * FIXME some of the app logic is in the test...
         */
        public function testSigningDetection( $line, $expectedUser ) {
+               $this->setMwGlobals( array(
+                       'wgLanguageCode' => 'pl',
+                       'wgContLang' => Language::factory( 'pl' ),
+                       'wgNamespaceAliases' => array(
+                               'Person' => NS_USER,
+                               'Person_talk' => NS_USER_TALK,
+                       ),
+               ) );
+
                if ( !EchoDiscussionParser::isSignedComment( $line ) ) {
                        $this->assertEquals( $expectedUser, false );
                        return;
@@ -106,6 +115,30 @@
                                        'Werdna'
                                ),
                        ),
+                       // Translated namespace name (in Polish, see setUp())
+                       array(
+                               "Zażółć gęślą jaźń. [[Użytkownik:Matma 
Rex|Matma Rex]] ([[Dyskusja użytkownika:Matma Rex|Matma Rex]]) $ts",
+                               array(
+                                       55,
+                                       'Matma Rex'
+                               ),
+                       ),
+                       // Translated namespace name, gendered (female) alias 
(in Polish, see setUp())
+                       array(
+                               "Zażółć gęślą jaźń. [[Użytkowniczka:Matma 
Rex|Matma Rex]] ([[Dyskusja użytkowniczki:Matma Rex|Matma Rex]]) $ts",
+                               array(
+                                       58,
+                                       'Matma Rex'
+                               ),
+                       ),
+                       // Custom aliased namespaces
+                       array(
+                               "I like this. [[Person:Werdna]] ([[Person 
talk:Werdna|talk]]) $ts",
+                               array(
+                                       32,
+                                       'Werdna'
+                               ),
+                       ),
                        // Anonymous user
                        array(
                                "I am anonymous because I like my IP address. 
--[[Special:Contributions/127.0.0.1]] $ts",
@@ -114,6 +147,14 @@
                                        '127.0.0.1'
                                ),
                        ),
+                       // Anonymous user
+                       array(
+                               "I am anonymous because I like my IP address. 
--[[Specjalna:Wkład/127.0.0.1]] $ts",
+                               array(
+                                       47,
+                                       '127.0.0.1'
+                               ),
+                       ),
                        // No signature
                        array(
                                "Well, \nI do think that [[User:Newyorkbrad]] 
is pretty cool, but what do I know?", 

-- 
To view, visit https://gerrit.wikimedia.org/r/163844
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iebd60aab83b0a5695b2a006f0e723e127302c35a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to