diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index 13f9dd6..de7e2aa 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -309,9 +309,10 @@ function simpletest_phpunit_run_command(array $unescaped_test_classnames, $phpun // functional tests can connect to the database. putenv('SIMPLETEST_DB=' . Database::getConnectionInfoAsUrl()); - // Setup an environment variable containing the base URL so that functional - // tests can browser the site under test. - $existing_simpletest_base_url = getenv('SIMPLETEST_BASE_URL'); + // Setup an environment variable containing the base URL, if it is available. + // This allows functional tests to browse the site under test. When running + // tests via CLI, core/phpunit.xml.dist or core/scripts/run-tests.sh can set + // this variable. if ($base_url) { putenv('SIMPLETEST_BASE_URL=' . $base_url); } @@ -353,7 +354,7 @@ function simpletest_phpunit_run_command(array $unescaped_test_classnames, $phpun chdir($old_cwd); putenv('SIMPLETEST_DB='); if ($base_url) { - putenv('SIMPLETEST_BASE_URL=' . $existing_simpletest_base_url); + putenv('SIMPLETEST_BASE_URL='); } return $ret; }