This commit is contained in:
Andreas Schamberger 2012-01-15 11:44:05 +01:00
parent 375cd7debb
commit f0b596be99

View File

@ -23,11 +23,12 @@ class CurlTest extends \PHPUnit_Framework_TestCase
protected function startPhpWebserver() protected function startPhpWebserver()
{ {
if ('Windows' == substr(php_uname('s'), 0, 7 )) { $dir = __DIR__.DIRECTORY_SEPARATOR.'Fixtures';
$powershellCommand = "\$app = start-process php.exe -ArgumentList '-S localhost:8000 -t ".__DIR__.DIRECTORY_SEPARATOR."Fixtures' -WindowStyle 'Hidden' -passthru; Echo \$app.Id;"; if ('Windows' == substr(php_uname('s'), 0, 7)) {
$powershellCommand = "\$app = start-process php.exe -ArgumentList '-S localhost:8000 -t ".$dir."' -WindowStyle 'Hidden' -passthru; Echo \$app.Id;";
$shellCommand = 'powershell -command "& {'.$powershellCommand.'}"'; $shellCommand = 'powershell -command "& {'.$powershellCommand.'}"';
} else { } else {
$shellCommand = "nohup php -S localhost:8000 -t ".__DIR__.DIRECTORY_SEPARATOR."Fixtures &"; $shellCommand = "nohup php -S localhost:8000 -t ".$dir." &";
} }
$output = array(); $output = array();
exec($shellCommand, $output); exec($shellCommand, $output);