summaryrefslogtreecommitdiffstats
path: root/Horde_Translation-except.patch
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2013-01-15 14:43:12 +0100
committerRemi Collet <fedora@famillecollet.com>2013-01-15 14:43:12 +0100
commit0a05e18613f9e860c6eff01b473b3822259a882b (patch)
treee548a41df3256e02fbd41a240f589b7149c59ae4 /Horde_Translation-except.patch
parentd06e07adca344bf41f5e2481a74c92e41f5d266a (diff)
patch for http://bugs.horde.org/ticket/11958
: Allow to run unit tests for a not installed component
Diffstat (limited to 'Horde_Translation-except.patch')
-rw-r--r--Horde_Translation-except.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/Horde_Translation-except.patch b/Horde_Translation-except.patch
new file mode 100644
index 0000000..176033b
--- /dev/null
+++ b/Horde_Translation-except.patch
@@ -0,0 +1,28 @@
+From 64f3fd80a8f084d2d305274bed8d60a9fd2bb5fd Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Tue, 15 Jan 2013 13:45:43 +0100
+Subject: [PATCH] dont raise exception when running unit tests
+
+---
+ framework/Translation/lib/Horde/Translation/Handler/Gettext.php | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/framework/Translation/lib/Horde/Translation/Handler/Gettext.php b/framework/Translation/lib/Horde/Translation/Handler/Gettext.php
+index f0d460f..0b44861 100644
+--- a/framework/Translation/lib/Horde/Translation/Handler/Gettext.php
++++ b/framework/Translation/lib/Horde/Translation/Handler/Gettext.php
+@@ -40,7 +40,10 @@ 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");
++ // dont raise exception when running unit tests (for not installed package)
++ if (!isset($_SERVER['argv'][0]) || !strpos($_SERVER['argv'][0], 'phpunit')) {
++ throw new InvalidArgumentException("$path is not a directory");
++ }
+ }
+ $this->_gettext = function_exists('_');
+ if (!$this->_gettext) {
+--
+1.7.10
+