$this->root = $civicrm_root;
$this->settingsPath = defined('CIVICRM_SETTINGS_PATH') ? CIVICRM_SETTINGS_PATH : NULL;
$this->defaultParams = $defaultParams;
+ $this->addEnv(array(
+ 'CIVICRM_UF' => CIVICRM_UF,
+ ));
}
/**
* (Administer::System Settings::Resource URLs).
*/
if (!defined('CIVICRM_UF')) {
- define( 'CIVICRM_UF', '%%cms%%');
+ if (getenv('CIVICRM_UF')) {
+ define('CIVICRM_UF', getenv('CIVICRM_UF'));
+ }
+ else {
+ define('CIVICRM_UF', '%%cms%%');
+ }
}
/**
);
$calls = new \Civi\API\ExternalBatch($defaultParams);
- $calls->setSettingsPath("$civicrm_root/tests/phpunit/CiviTest/civicrm.settings.cli.php");
if (!$calls->isSupported()) {
$this->markTestSkipped('The test relies on Civi\API\ExternalBatch. This is unsupported in the local environment.');
# Crank up the memory
ini_set('memory_limit', '2G');
-// TODO Consider moving into main civicrm.settings.php so that `cv('api')` works better.
-if (!defined('CIVICRM_UF') && getenv('CIVICRM_UF')) {
- define('CIVICRM_UF', getenv('CIVICRM_UF'));
-}
-
eval(cv('php:boot --test', 1));
// This is exists to support CiviUnitTestCase::populateDB(). That doesn't make it a good idea.
+++ /dev/null
-<?php
-// Set a variable on your shell:
-// export CIVICRM_TEST_DSN= mysql://db_username:db_password@localhost/civicrm_tests_dev
-// or modify and uncomment the configuration string under with your own config
-// This file is a template for applying local-only test configuration options.
-// It should be copied to "civicrm.settings.local.php".
-
-// For more details, see:
-// http://wiki.civicrm.org/confluence/display/CRM/Setting+up+your+personal+testing+sandbox+HOWTO
-
-// Set the data-source for the test database. Tables in this database will be periodically
-// deleted, truncated, etc.
-// define( 'CIVICRM_DSN', "mysql://db_username:db_password@localhost/civicrm_tests_dev" );
-
-// To disable auto-generation of files in api/v3/examples:
-// define('DONT_DOCUMENT_TEST_CONFIG', TRUE);