aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-25 15:39:36 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-25 15:39:36 +0000
commit21db3ef6daeaa4d0da05a7e89c30244e9caff0fd (patch)
tree9f644549b20f6e3ff8e413659398bed1b8810066
parent59025b501cce479dfded2a6c79a459170965679b (diff)
downloadsemanticscuttle-21db3ef6daeaa4d0da05a7e89c30244e9caff0fd.tar.gz
semanticscuttle-21db3ef6daeaa4d0da05a7e89c30244e9caff0fd.tar.bz2
fix unit test runs for direct phpunit calls
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@413 b3834d28-1941-0410-a4f8-b48e95affb8f
-rw-r--r--src/SemanticScuttle/header.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/SemanticScuttle/header.php b/src/SemanticScuttle/header.php
index 4857054..9615199 100644
--- a/src/SemanticScuttle/header.php
+++ b/src/SemanticScuttle/header.php
@@ -11,6 +11,15 @@ set_include_path(
$datadir = dirname(__FILE__) . '/../../data/';
require_once $datadir . '/config.default.php';
require_once $datadir . '/config.php';
+
+if (defined('UNIT_TEST_MODE')) {
+ //make local config vars global - needed for unit tests
+ //run with phpunit
+ foreach (get_defined_vars() as $var => $value) {
+ $GLOBALS[$var] = $value;
+ }
+}
+
require_once 'SemanticScuttle/constants.php'; // some constants are based on variables from config file