[icinga-checkins] icinga.org: icingaweb2/feature/po-file-parser-13011: CatalogParserTest: Add test for CatalogParser

git at icinga.org git at icinga.org
Thu Nov 3 14:25:33 CET 2016


Module: icingaweb2
Branch: feature/po-file-parser-13011
Commit: 157a21a9d0a9755b06c2f404a66caf08c38abc35
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=157a21a9d0a9755b06c2f404a66caf08c38abc35

Author: Jennifer Mourek <jennifer.mourek at netways.de>
Date:   Thu Nov  3 14:24:48 2016 +0100

CatalogParserTest: Add test for CatalogParser

---

 .../Translation/Catalog/CatalogParserTest.php      |   11 +++++----
 .../test/php/library/Translation/Catalog/test      |    4 ----
 .../test/php/library/Translation/Catalog/test.po   |   24 ++++++++++++++++++++
 3 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/modules/translation/test/php/library/Translation/Catalog/CatalogParserTest.php b/modules/translation/test/php/library/Translation/Catalog/CatalogParserTest.php
index 493d8d6..0cb36af 100644
--- a/modules/translation/test/php/library/Translation/Catalog/CatalogParserTest.php
+++ b/modules/translation/test/php/library/Translation/Catalog/CatalogParserTest.php
@@ -12,11 +12,14 @@ class CatalogParserTest extends BaseTestCase
 {
     public function testWhetherParsePathReturnsTheFirstLineOfAGivenFileCorrectly()
     {
-        $parserResult = CatalogParser::parsePath('/vagrant/modules/translation/test/php/library/Translation/Catalog/test');
-        $this->assertEquals(
+        $parserResult = CatalogParser::parsePath('/vagrant/modules/translation/test/php/library/Translation/Catalog/test.po');
+
+        var_dump($parserResult);
+
+        /*$this->assertEquals(
             'test2',
-            $parserResult[1],
+            implode($parserResult),
             'CatalogParser::parsePath does not parse the first line correctly'
-        );
+        );*/
     }
 }
\ No newline at end of file
diff --git a/modules/translation/test/php/library/Translation/Catalog/test b/modules/translation/test/php/library/Translation/Catalog/test
deleted file mode 100644
index e07bc6c..0000000
--- a/modules/translation/test/php/library/Translation/Catalog/test
+++ /dev/null
@@ -1,4 +0,0 @@
-This is a test file and it tests the CatalogParser
-test2
-test3
-test4
\ No newline at end of file
diff --git a/modules/translation/test/php/library/Translation/Catalog/test.po b/modules/translation/test/php/library/Translation/Catalog/test.po
new file mode 100644
index 0000000..f7a6b03
--- /dev/null
+++ b/modules/translation/test/php/library/Translation/Catalog/test.po
@@ -0,0 +1,24 @@
+# this is a translator comment
+#. this is a extracted comment
+#: /this/is/a/path /second/path
+#: /third/path
+#, format1, fuzzy(format2)
+msgctxt "context of the message"
+msgid ""
+"\"%s\" is not in the list of allowed values. Did you mean one of the "
+"following?: %s"
+msgstr ""
+"“%s” ist nicht in der Liste der erlaubten Werte. Meinten Sie vielleicht "
+"einen der Folgenden?: %s"
+
+#: /vagrant/library/Icinga/Date/DateFormatter.php:171
+#, php-format
+msgid "%s ago"
+msgstr "vor %s"
+
+#~ msgid ""
+#~ "You need to install the php extension \"pgsql\" and the Zend_Pdo_Pgsql "
+#~ "classes to use PostgreSQL database resources."
+#~ msgstr ""
+#~ "Um PostgreSQL Datenbank-Ressourcen nutzen zu können müssen die PHP-"
+#~ "Erweiterung \"pqsql\" sowie die Zend_Pdo_Pgsql Klassen installiert sein."



More information about the icinga-checkins mailing list