diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-06-10 16:17:02 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-06-10 16:17:02 +0000 |
commit | 027c1e97ead2814fdd3aee20b50ad02b368ae529 (patch) | |
tree | 51cea08e03965b5a75546d07010cfb56fa3419a1 /scripts/run-tests.sh | |
parent | a13bad5890cd45536dd8e01cab43290acf70c23a (diff) | |
download | brdo-027c1e97ead2814fdd3aee20b50ad02b368ae529.tar.gz brdo-027c1e97ead2814fdd3aee20b50ad02b368ae529.tar.bz2 |
- Patch #484610 by Damien Tournoud: do not start an output buffer when running in CLI mode.
Diffstat (limited to 'scripts/run-tests.sh')
-rwxr-xr-x | scripts/run-tests.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/run-tests.sh b/scripts/run-tests.sh index ada07c75c..f370d65a7 100755 --- a/scripts/run-tests.sh +++ b/scripts/run-tests.sh @@ -12,16 +12,20 @@ define('SIMPLETEST_SCRIPT_COLOR_EXCEPTION', 33); // Brown. // Set defaults and get overrides. list($args, $count) = simpletest_script_parse_args(); -simpletest_script_init(); - if ($args['help'] || $count == 0) { simpletest_script_help(); exit; } if ($args['execute-batch']) { + // Masquerade as Apache for running tests. + simpletest_script_init("Apache"); simpletest_script_execute_batch(); } +else { + // Run administrative functions as CLI. + simpletest_script_init("PHP CLI"); +} // Bootstrap to perform initial validation or other operations. drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); @@ -226,7 +230,7 @@ function simpletest_script_parse_args() { /** * Initialize script variables and perform general setup requirements. */ -function simpletest_script_init() { +function simpletest_script_init($server_software) { global $args, $php; $host = 'localhost'; @@ -260,7 +264,7 @@ function simpletest_script_init() { $_SERVER['HTTP_HOST'] = $host; $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; $_SERVER['SERVER_ADDR'] = '127.0.0.1'; - $_SERVER['SERVER_SOFTWARE'] = 'Apache'; + $_SERVER['SERVER_SOFTWARE'] = $server_software; $_SERVER['SERVER_NAME'] = 'localhost'; $_SERVER['REQUEST_URI'] = $path .'/'; $_SERVER['REQUEST_METHOD'] = 'GET'; |