Jarry1250 has submitted this change and it was merged.

Change subject: Stop implicitly testing group name normalisation
......................................................................


Stop implicitly testing group name normalisation

Mental overhead was getting unbearable, should be tested explicitly or
not at all.

Change-Id: I2e415ee96e4b4d1c9ce12c4f5ab62ae6a55c50ed
---
M tests/phpunit/SVGMessageGroupTest.php
M tests/phpunit/TranslateSvgTestCase.php
2 files changed, 4 insertions(+), 8 deletions(-)

Approvals:
  Jarry1250: Verified; Looks good to me, approved



diff --git a/tests/phpunit/SVGMessageGroupTest.php 
b/tests/phpunit/SVGMessageGroupTest.php
index 2329825..5234584 100644
--- a/tests/phpunit/SVGMessageGroupTest.php
+++ b/tests/phpunit/SVGMessageGroupTest.php
@@ -21,8 +21,7 @@
        public function testRegistration() {
                // In order that a lot of the tests function, prepareFile() 
calls register()
                // but we should check now that it's worked
-               $name = str_replace( '_', ' ', self::$name );
-               $group = MessageGroups::getGroup( $name );
+               $group = MessageGroups::getGroup( self::$name );
 
                // $group is either of type SVGMessageGroup (success) or null 
(failure)
                $this->assertInstanceOf( 'SVGMessageGroup', $group );
@@ -52,15 +51,11 @@
        }
 
        public function testGetId() {
-               // Should be normalised to spaces
-               $name = str_replace( '_', ' ', self::$name );
-               $this->assertEquals( $name, $this->messageGroup->getId() );
+               $this->assertEquals( self::$name, $this->messageGroup->getId() 
);
        }
 
        public function testGetLabel() {
-               // Should be normalised to spaces
-               $name = str_replace( '_', ' ', self::$name );
-               $this->assertEquals( $name, $this->messageGroup->getLabel() );
+               $this->assertEquals( self::$name, 
$this->messageGroup->getLabel() );
        }
 
        public function testGetNamespace() {
diff --git a/tests/phpunit/TranslateSvgTestCase.php 
b/tests/phpunit/TranslateSvgTestCase.php
index 4bf23f5..b2a018c 100644
--- a/tests/phpunit/TranslateSvgTestCase.php
+++ b/tests/phpunit/TranslateSvgTestCase.php
@@ -28,6 +28,7 @@
                copy( $path, $tempName );
 
                $name = substr( basename( $path ), 0, -4 ) . '_' . date( 'His' 
) . '.svg';
+               $name = str_replace( '_', ' ', $name );
                $title = Title::makeTitle( NS_FILE, $name );
                if( $title->exists()  ) {
                        $wikiPage = new WikiPage( $title );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2e415ee96e4b4d1c9ce12c4f5ab62ae6a55c50ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TranslateSvg
Gerrit-Branch: master
Gerrit-Owner: Jarry1250 <jarry1...@gmail.com>
Gerrit-Reviewer: Jarry1250 <jarry1...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to