diff --git a/src/Cli/TestRunner.php b/src/Cli/TestRunner.php index 84071f33..76479395 100644 --- a/src/Cli/TestRunner.php +++ b/src/Cli/TestRunner.php @@ -117,6 +117,7 @@ private function testAcceptance() { $result = 0; $baseCwd = getcwd(); $gtroot = Path::get(Path::GTROOT); + $root = Path::get(Path::ROOT); $testPath = Path::fixCase($this->approot . "/test/Acceptance"); if(!is_dir($testPath)) { @@ -128,7 +129,8 @@ private function testAcceptance() { mkdir($testWebroot, 0775, true); } - $serverCommand = "$gtroot/bin/serve --approot=$testPath --port=8089"; + + $serverCommand = "$gtroot/bin/serve --approot=$root --port=8089"; $server = proc_open($serverCommand, $this->descriptorSpec, $pipes); chdir($testPath); diff --git a/src/Core/Path.php b/src/Core/Path.php index c6cfea79..dd3b4f26 100644 --- a/src/Core/Path.php +++ b/src/Core/Path.php @@ -60,7 +60,12 @@ public static function get($name) { break; case self::ROOT: - $p = dirname($_SERVER["DOCUMENT_ROOT"]); + if(empty($_SERVER["DOCUMENT_ROOT"])) { + $p = getcwd(); + } + else { + $p = dirname($_SERVER["DOCUMENT_ROOT"]); + } break; case self::SCRIPT: