This has been set in civicrm.settings.dist.php, but we're moving toward a
consolidated settings file. But we still need bit of logic which says: "Run
most unit tests in a headless environment." This pushes the policy pretty
far outside the code.
'PHPUnit' . DIRECTORY_SEPARATOR .
'Autoload.php';
*/
+
+if (!defined('CIVICRM_UF') && getenv('CIVICRM_UF')) {
+ define('CIVICRM_UF', getenv('CIVICRM_UF'));
+}
\ No newline at end of file
elseif (preg_match('/^Civi\\\\/', $v)) {
$argv[$k] = 'tests/phpunit/' . strtr($v, '\\', '/') . '.php';
}
+
+ if (!preg_match('/^(WebTest)/', $v)) {
+ putenv('CIVICRM_UF=UnitTests');
+ }
}
// Transition: Make sure we use phpunit code from PATH, not
$cmd =
findPhp() // In case this system has multiple copies of PHP, use the active/preferred one.
+ // . ' -ddisplay_errors=1'
. ' '
. escapeshellarg($phpunit)
. ' '