From 8582a9fcdd4ba2302ae442b0216afa8f5cb4c3bb Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 22 Jan 2016 03:26:39 -0800 Subject: [PATCH] CRM-17860 - CiviUnitTestCase::_populateDB() - Guard against accidental destruction --- tests/phpunit/CiviTest/CiviUnitTestCase.php | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.25.1