From af8a4943e7888866b6ea788b0c3fa5bfc405be78 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel Date: Fri, 12 Nov 2010 17:44:46 +0100 Subject: [PATCH] Quoting. --- .../Translation/lib/Horde/Translation/Handler/Gettext.php | 2 +- framework/Translation/test/Horde/Translation/GettextTest.php | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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() + ); + } + } } -- 2.11.0