CRM-16373 - CRM_Core_BAO_ConfigSetting - Fix enableComponent
[civicrm-core.git] / tests / phpunit / CiviTest / CiviCaseTestCase.php
index ce6f032591b16e7cddb8a8264265d8f719594769..3d14d4c68618f55bdaaf7afcc583b2033176a36a 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -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
@@ -99,6 +93,7 @@ class CiviCaseTestCase extends CiviUnitTestCase {
       'civicrm_managed',
       'civicrm_relationship',
       'civicrm_relationship_type',
+      'civicrm_uf_match',
     );
 
     $this->quickCleanup($this->tablesToTruncate);
@@ -112,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();