moves setting of SERVER vars in test bootstrap
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 8 Jun 2016 08:29:32 +0000 (10:29 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 10 Jun 2016 10:39:18 +0000 (12:39 +0200)
Change-Id: Ib64d446806fbd604032417e5364bf85a465ec376
Reviewed-on: http://gerrit.tine20.com/customers/3206
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/TestServer.php

index 2388e67..994734e 100644 (file)
@@ -54,6 +54,10 @@ class TestServer
 
         $config = $this->getConfig();
 
+        // set some server vars. sabredav complains if REQUEST_URI is not set
+        $_SERVER['DOCUMENT_ROOT'] = $config->docroot;
+        $_SERVER['REQUEST_URI'] = '';
+
         Tinebase_Core::startCoreSession();
         
         Tinebase_Core::initFramework();
@@ -166,12 +170,11 @@ class TestServer
             $config = new Zend_Config($configData);
 
             Zend_Registry::set('testConfig', $config);
-
-            $_SERVER['DOCUMENT_ROOT'] = $config->docroot;
-            $_SERVER['REQUEST_URI'] = '';
+        } else {
+            $config = Zend_Registry::get('testConfig');
         }
 
-        return Zend_Registry::get('testConfig');
+        return $config;
     }
     
     /**