Quoting.
authorGunnar Wrobel <p@rdus.de>
Fri, 12 Nov 2010 16:44:46 +0000 (17:44 +0100)
committerGunnar Wrobel <p@rdus.de>
Fri, 12 Nov 2010 16:46:52 +0000 (17:46 +0100)
framework/Translation/lib/Horde/Translation/Handler/Gettext.php
framework/Translation/test/Horde/Translation/GettextTest.php

index 18364ae..68281e9 100644 (file)
@@ -40,7 +40,7 @@ class Horde_Translation_Handler_Gettext implements Horde_Translation_Handler
     public function __construct($domain, $path)
     {
         if (!is_dir($path)) {
-            throw new InvalidArgumentException('$path is not a directory');
+            throw new InvalidArgumentException("$path is not a directory");
         }
         $this->_gettext = function_exists('_');
         if (!$this->_gettext) {
index 959063f..b1a7912 100644 (file)
@@ -34,4 +34,16 @@ class Horde_Translation_GettextTest extends Horde_Translation_TestBase
         $this->assertEquals('1 Woche', sprintf($this->_dict->ngettext('%d week', '%d weeks', 1), 1));
         $this->assertEquals('2 Wochen', sprintf($this->_dict->ngettext('%d week', '%d weeks', 2), 2));
     }
+
+    public function testInvalidConstruction()
+    {
+        try {
+            new Horde_Translation_Handler_Gettext('Horde_Translation', dirname(__FILE__) . '/DOES_NOT_EXIST');
+        } catch (InvalidArgumentException $e) {
+            $this->assertEquals(
+                dirname(__FILE__) . '/DOES_NOT_EXIST is not a directory',
+                $e->getMessage()
+            );
+        }
+    }
 }