From 027c1e97ead2814fdd3aee20b50ad02b368ae529 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 10 Jun 2009 16:17:02 +0000 Subject: - Patch #484610 by Damien Tournoud: do not start an output buffer when running in CLI mode. --- scripts/run-tests.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'scripts/run-tests.sh') 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'; -- cgit v1.2.3