当前位置: 首页>>代码示例>>PHP>>正文


PHP CiviUnitTestCase::_populateDB方法代码示例

本文整理汇总了PHP中CiviUnitTestCase::_populateDB方法的典型用法代码示例。如果您正苦于以下问题:PHP CiviUnitTestCase::_populateDB方法的具体用法?PHP CiviUnitTestCase::_populateDB怎么用?PHP CiviUnitTestCase::_populateDB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CiviUnitTestCase的用法示例。


在下文中一共展示了CiviUnitTestCase::_populateDB方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _populateDB

 protected static function _populateDB($perClass = FALSE, &$object = NULL)
 {
     if (!parent::_populateDB($perClass, $object)) {
         return FALSE;
     }
     _hrrecruitment_phpunit_populateDB();
     return TRUE;
 }
开发者ID:JoeMurray,项目名称:civihr,代码行数:8,代码来源:HRSearchVacancyTest.php

示例2: _populateDB

 protected static function _populateDB($perClass = FALSE, &$object = NULL)
 {
     if (!parent::_populateDB($perClass, $object)) {
         return FALSE;
     }
     _hrvisa_phpunit_populateDB();
     //also create 'Visa Expiration' actvity type
     $params = array('weight' => 1, 'label' => 'Visa Expiration', 'filter' => 0, 'is_active' => 1, 'is_default' => 0);
     $result = civicrm_api3('activity_type', 'create', $params);
     return TRUE;
 }
开发者ID:JoeMurray,项目名称:civihr,代码行数:11,代码来源:ActivityTest.php

示例3: _populateDB

 /**
  * Ensure that, if the database is repopulated, CiviVolunteer's install
  * operations are run, adding custom option group, activity fields, etc. to
  * the testing db.
  *
  * @param type $perClass
  * @param type $object
  * @return boolean
  */
 protected static function _populateDB($perClass = FALSE, &$object = NULL)
 {
     if (!parent::_populateDB($perClass, $object)) {
         return FALSE;
     }
     // code adapted from CRM_Volunteer_Upgrader::install().
     $upgrader = new CRM_Volunteer_Upgrader('org.civicrm.volunteer', dirname(__FILE__) . '/../../');
     $activityTypeId = $upgrader->createActivityType(CRM_Volunteer_BAO_Assignment::CUSTOM_ACTIVITY_TYPE);
     $smarty = CRM_Core_Smarty::singleton();
     $smarty->assign('volunteer_custom_activity_type_name', CRM_Volunteer_BAO_Assignment::CUSTOM_ACTIVITY_TYPE);
     $smarty->assign('volunteer_custom_group_name', CRM_Volunteer_BAO_Assignment::CUSTOM_GROUP_NAME);
     $smarty->assign('volunteer_custom_option_group_name', CRM_Volunteer_BAO_Assignment::ROLE_OPTION_GROUP);
     $smarty->assign('volunteer_activity_type_id', $activityTypeId);
     $customIDs = $upgrader->findCustomGroupValueIDs();
     $smarty->assign('customIDs', $customIDs);
     $upgrader->executeCustomDataTemplateFile('volunteer-customdata.xml.tpl');
     $upgrader->createVolunteerActivityStatus();
     return TRUE;
 }
开发者ID:Hack4Eugene,项目名称:Hack4Cause2016,代码行数:28,代码来源:VolunteerTestAbstract.php

示例4: _populateDB

 protected static function _populateDB($perClass = FALSE, &$object = NULL)
 {
     if (!parent::_populateDB($perClass, $object)) {
         return FALSE;
     }
     //populate vacancy_status of type Application
     $result = civicrm_api3('OptionGroup', 'create', array('name' => 'vacancy_status', 'title' => ts('Vacancy Status'), 'is_reserved' => 1, 'is_active' => 1));
     $vacancyStatus = array('Draft' => ts('Draft'), 'Open' => ts('Open'), 'Closed' => ts('Closed'), 'Cancelled' => ts('Cancelled'), 'Rejected' => ts('Rejected'));
     $weight = 1;
     foreach ($vacancyStatus as $name => $label) {
         $statusParam = array('option_group_id' => $result['id'], 'label' => $label, 'name' => $name, 'value' => $weight++, 'is_active' => 1);
         if ($name == 'Draft') {
             $statusParam['is_default'] = 1;
         } elseif ($name == 'Open') {
             $statusParam['is_reserved'] = 1;
         }
         civicrm_api3('OptionValue', 'create', $statusParam);
     }
     $import = new CRM_Utils_Migrate_Import();
     $import->run(CRM_Extension_System::singleton()->getMapper()->keyToBasePath('org.civicrm.hrrecruitment') . '/xml/auto_install.xml');
     return TRUE;
 }
开发者ID:JoeMurray,项目名称:civihr,代码行数:22,代码来源:HRVacancyStageTest.php


注:本文中的CiviUnitTestCase::_populateDB方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。