From: Tim Otten Date: Fri, 22 Jan 2016 11:26:39 +0000 (-0800) Subject: CRM-17860 - CiviUnitTestCase::_populateDB() - Guard against accidental destruction X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8582a9fcdd4ba2302ae442b0216afa8f5cb4c3bb;p=civicrm-core.git CRM-17860 - CiviUnitTestCase::_populateDB() - Guard against accidental destruction --- diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index c952af0dfb..ee73850bb3 100755 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -249,6 +249,9 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { * TRUE if the populate logic runs; FALSE if it is skipped */ protected static function _populateDB($perClass = FALSE, &$object = NULL) { + if (CIVICRM_UF !== 'UnitTests') { + throw new \RuntimeException("_populateDB requirs CIVICRM_UF=UnitTests"); + } if ($perClass || $object == NULL) { $dbreset = TRUE;