From: Gunnar Wrobel
Date: Fri, 12 Nov 2010 16:44:46 +0000 (+0100) Subject: Quoting. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=af8a4943e7888866b6ea788b0c3fa5bfc405be78;p=horde.git Quoting. --- diff --git a/framework/Translation/lib/Horde/Translation/Handler/Gettext.php b/framework/Translation/lib/Horde/Translation/Handler/Gettext.php index 18364aec2..68281e9fc 100644 --- a/framework/Translation/lib/Horde/Translation/Handler/Gettext.php +++ b/framework/Translation/lib/Horde/Translation/Handler/Gettext.php @@ -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) { diff --git a/framework/Translation/test/Horde/Translation/GettextTest.php b/framework/Translation/test/Horde/Translation/GettextTest.php index 959063f63..b1a79123c 100644 --- a/framework/Translation/test/Horde/Translation/GettextTest.php +++ b/framework/Translation/test/Horde/Translation/GettextTest.php @@ -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() + ); + } + } }