CRM-16373 - CRM_Core_BAO_ConfigSetting - Fix enableComponent
[civicrm-core.git] / tests / phpunit / CiviTest / CiviCaseTestCase.php
index 553886d563ccb00f378d4ee23ac1b2f53acf0718..3d14d4c68618f55bdaaf7afcc583b2033176a36a 100644 (file)
@@ -48,12 +48,6 @@ class CiviCaseTestCase extends CiviUnitTestCase {
   public function setUp() {
     parent::setUp();
 
-    /** @var $hooks \CRM_Utils_Hook_UnitTests */
-    $hooks = \CRM_Utils_Hook::singleton();
-    $hooks->setHook('civicrm_caseTypes', array($this, 'hook_caseTypes'));
-    \CRM_Case_XMLRepository::singleton(TRUE);
-    \CRM_Case_XMLProcessor::flushStaticCaches();
-
     // CRM-9404 - set-up is a bit cumbersome but had to put something in place to set up activity types & case types
     //. Using XML was causing breakage as id numbers were changing over time
     // & was really hard to troubleshoot as involved truncating option_value table to mitigate this & not leaving DB in a
@@ -113,6 +107,12 @@ class CiviCaseTestCase extends CiviUnitTestCase {
     $enableResult = CRM_Core_BAO_ConfigSetting::enableComponent('CiviCase');
     $this->assertTrue($enableResult, 'Cannot enable CiviCase in line ' . __LINE__);
 
+    /** @var $hooks \CRM_Utils_Hook_UnitTests */
+    $hooks = \CRM_Utils_Hook::singleton();
+    $hooks->setHook('civicrm_caseTypes', array($this, 'hook_caseTypes'));
+    \CRM_Case_XMLRepository::singleton(TRUE);
+    \CRM_Case_XMLProcessor::flushStaticCaches();
+
     // create a logged in USER since the code references it for source_contact_id
     $this->createLoggedInUser();
     $session = CRM_Core_Session::singleton();