Jarry1250 has uploaded a new change for review.

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

Change subject: Add testImportTranslations() and testGetOnWikiLanguages()
......................................................................

Add testImportTranslations() and testGetOnWikiLanguages()

Change-Id: I7a2a3ee65a66e8b3ba41a38a0a0f1f70b715822a
---
M tests/phpunit/SVGMessageGroupTest.php
1 file changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TranslateSvg 
refs/changes/33/155733/1

diff --git a/tests/phpunit/SVGMessageGroupTest.php 
b/tests/phpunit/SVGMessageGroupTest.php
index 2329825..5fc298c 100644
--- a/tests/phpunit/SVGMessageGroupTest.php
+++ b/tests/phpunit/SVGMessageGroupTest.php
@@ -66,4 +66,25 @@
        public function testGetNamespace() {
                $this->assertEquals( NS_FILE, 
$this->messageGroup->getNamespace() );
        }
+
+       public function testGetOnWikiLanguagesBeforeImport() {
+               $this->assertCount(
+                       0,
+                       $this->messageGroup->getOnWikiLanguages(),
+                       'Message group is registered but has not been imported 
yet, so getOnWikiLanguages() should return an empty array'
+               );
+       }
+
+       public function testImportTranslations() {
+               $ret = $this->messageGroup->importTranslations();
+               $this->assertTrue( $ret );
+       }
+
+       public function testGetOnWikiLanguagesAfterImport() {
+               // Clearly this is dependent on the translations having been 
imported correctly
+               $this->assertArrayEquals(
+                       array( 'de', 'en', 'fr', 'nl' ),
+                       $this->messageGroup->getOnWikiLanguages()
+               );
+       }
 }
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7a2a3ee65a66e8b3ba41a38a0a0f1f70b715822a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TranslateSvg
Gerrit-Branch: master
Gerrit-Owner: Jarry1250 <jarry1...@gmail.com>

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

Reply via email to