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


PHP Civi::reset方法代码示例

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


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

示例1: tearDown

 public function tearDown()
 {
     parent::tearDown();
     \Civi::reset();
 }
开发者ID:konadave,项目名称:civicrm-core,代码行数:5,代码来源:ManagedEntitiesTest.php

示例2: tearDown

 protected function tearDown()
 {
     parent::tearDown();
     $this->cleanupFiles();
     \Civi::reset();
 }
开发者ID:konadave,项目名称:civicrm-core,代码行数:6,代码来源:AttachmentTest.php

示例3: setUp

 /**
  *  Common setup functions for all unit tests.
  */
 protected function setUp()
 {
     $session = CRM_Core_Session::singleton();
     $session->set('userID', NULL);
     $this->errorScope = CRM_Core_TemporaryErrorScope::useException();
     // REVERT
     //  Use a temporary file for STDIN
     $GLOBALS['stdin'] = tmpfile();
     if ($GLOBALS['stdin'] === FALSE) {
         echo "Couldn't open temporary file\n";
         exit(1);
     }
     //  Get and save a connection to the database
     $this->_dbconn = $this->getConnection();
     // reload database before each test
     //        $this->_populateDB();
     // "initialize" CiviCRM to avoid problems when running single tests
     // FIXME: look at it closer in second stage
     $GLOBALS['civicrm_setting']['domain']['fatalErrorHandler'] = 'CiviUnitTestCase_fatalErrorHandler';
     $GLOBALS['civicrm_setting']['domain']['backtrace'] = 1;
     // disable any left-over test extensions
     CRM_Core_DAO::executeQuery('DELETE FROM civicrm_extension WHERE full_name LIKE "test.%"');
     // reset all the caches
     CRM_Utils_System::flushCache();
     // initialize the object once db is loaded
     \Civi::reset();
     $config = CRM_Core_Config::singleton(TRUE, TRUE);
     // ugh, performance
     // when running unit tests, use mockup user framework
     $this->hookClass = CRM_Utils_Hook::singleton();
     // Make sure the DB connection is setup properly
     $config->userSystem->setMySQLTimeZone();
     $env = new CRM_Utils_Check_Component_Env();
     CRM_Utils_Check::singleton()->assertValid($env->checkMysqlTime());
     // clear permissions stub to not check permissions
     $config->userPermissionClass->permissions = NULL;
     //flush component settings
     CRM_Core_Component::getEnabledComponents(TRUE);
     error_reporting(E_ALL);
     $this->_sethtmlGlobals();
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:44,代码来源:CiviUnitTestCase.php

示例4: bootHeadless

 /**
  * @param HeadlessInterface|\PHPUnit_Framework_Test $test
  */
 protected function bootHeadless($test)
 {
     if (CIVICRM_UF !== 'UnitTests') {
         throw new \RuntimeException('HeadlessInterface requires CIVICRM_UF=UnitTests');
     }
     // Hrm, this seems wrong. Shouldn't we be resetting the entire session?
     $session = \CRM_Core_Session::singleton();
     $session->set('userID', NULL);
     $test->setUpHeadless();
     $config = \CRM_Core_Config::singleton(TRUE, TRUE);
     // ugh, performance
     \CRM_Utils_System::flushCache();
     \Civi::reset();
     \CRM_Core_Session::singleton()->set('userID', NULL);
     if (property_exists($config->userPermissionClass, 'permissions')) {
         $config->userPermissionClass->permissions = NULL;
     }
 }
开发者ID:sdekok,项目名称:civicrm-core,代码行数:21,代码来源:CiviTestListener.php


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