From 3b2c20b706bed9c88895e2d69cf503a74f0a55cc Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 22 Jan 2016 12:29:59 -0800 Subject: [PATCH] CRM-17860 - CiviTest bootstrap - Move test define()s from `cv` to `civicrm.settings.php` --- templates/CRM/common/civicrm.settings.php.template | 5 +++++ tests/phpunit/CiviTest/bootstrap.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/templates/CRM/common/civicrm.settings.php.template b/templates/CRM/common/civicrm.settings.php.template index 33b8c5d26c..3da5559f4d 100644 --- a/templates/CRM/common/civicrm.settings.php.template +++ b/templates/CRM/common/civicrm.settings.php.template @@ -394,6 +394,11 @@ if (!defined('CIVICRM_DB_CACHE_PREFIX')) { // define('CIVICRM_MYSQL_STRICT', TRUE ); // } +if (CIVICRM_UF === 'UnitTests') { + if (!defined('CIVICRM_CONTAINER_CACHE')) define('CIVICRM_CONTAINER_CACHE', 'auto'); + if (!defined('CIVICRM_MYSQL_STRICT')) define('CIVICRM_MYSQL_STRICT', true); +} + /** * * Do not change anything below this line. Keep as is diff --git a/tests/phpunit/CiviTest/bootstrap.php b/tests/phpunit/CiviTest/bootstrap.php index 955ce7ef1f..7bf9877551 100644 --- a/tests/phpunit/CiviTest/bootstrap.php +++ b/tests/phpunit/CiviTest/bootstrap.php @@ -15,8 +15,8 @@ if (file_exists('/etc/timezone')) { # Crank up the memory ini_set('memory_limit', '2G'); - -eval(cv('php:boot --test', 1)); +define('CIVICRM_TEST', 1); +eval(cv('php:boot', 1)); // This is exists to support CiviUnitTestCase::populateDB(). That doesn't make it a good idea. require_once "DB.php"; -- 2.25.1