]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
fix unit test runs for direct phpunit calls
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Sun, 25 Oct 2009 15:39:36 +0000 (15:39 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Sun, 25 Oct 2009 15:39:36 +0000 (15:39 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@413 b3834d28-1941-0410-a4f8-b48e95affb8f

src/SemanticScuttle/header.php

index 485705453fdb18ecb64e632634cf5cd89898114d..9615199ccfc80d3d219c0ebf9ffcd0b987f66b6b 100644 (file)
@@ -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