本文整理匯總了PHP中LogicHook::refreshHooks方法的典型用法代碼示例。如果您正苦於以下問題:PHP LogicHook::refreshHooks方法的具體用法?PHP LogicHook::refreshHooks怎麽用?PHP LogicHook::refreshHooks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類LogicHook
的用法示例。
在下文中一共展示了LogicHook::refreshHooks方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testrefreshHooks
public function testrefreshHooks()
{
//execute the method and test if it doesn't throws an exception
try {
LogicHook::refreshHooks();
$this->assertTrue(true);
} catch (Exception $e) {
$this->fail();
}
}
示例2: tearDown
public function tearDown()
{
foreach ($this->renames as $file) {
rename($file . ".bak", $file);
}
foreach ($this->deletes as $file) {
unlink($file);
}
unset($GLOBALS['logic_hook']);
LogicHook::refreshHooks();
}
示例3: setUp
public function setUp()
{
$this->user = SugarTestUserUtilities::createAnonymousUser();
$GLOBALS['current_user'] = $this->user;
//Setup logichook files
if (file_exists($this->casesHookFile)) {
$this->hasCustomCasesLogicHookFile = true;
copy($this->casesHookFile, $this->casesHookFile . '.bak');
}
$hook_array['after_relationship_add'][] = array(1, 'Cases increment count', $this->casesCountFile, 'CaseCount', 'countMe');
write_array_to_file("hook_array", $hook_array, $this->casesHookFile);
$this->useOutputBuffering = false;
LogicHook::refreshHooks();
//now write out the script that the logichook executes. This will keep track of times called
global $hookRunCount;
$hookRunCount = 0;
$fileCont = '<?php class CaseCount {
function countMe($bean, $event, $arguments){
global $hookRunCount;
if($event =="after_relationship_add" && $arguments["module"]=="Cases" && $arguments["related_module"]=="Emails")
$hookRunCount++;
}}?>';
file_put_contents($this->casesCountFile, $fileCont);
//setup test account for case
$this->account = new Account();
$this->account->name = 'test account for bug 39855';
$this->account->assigned_user_id = 'SugarUser';
$this->account->save();
//create case
$this->case = new aCase();
$this->case->name = 'test case for unitTest 49784';
$this->case->account_id = $this->account->id;
$this->case->status = 'New';
$this->case->save();
//retrieve so we have latest info (case number)
$this->case->retrieve($this->case->id);
//create email with case in subject
$this->email = new Email();
$this->email->type = 'inbound';
$this->email->status = 'unread';
$this->email->from_addr_name = $this->email->cleanEmails("sender@domain.eu");
$this->email->to_addrs_names = $this->email->cleanEmails("to@domain.eu");
$this->email->cc_addrs_names = $this->email->cleanEmails("cc@domain.eu");
$this->email->name = 'RE: [CASE:' . $this->case->case_number . '] ' . $this->case->name;
$this->email->save();
}
示例4: setUp
public function setUp()
{
//Setup mock logic hook files
if (file_exists($this->modulesHookFile)) {
$this->hasCustomModulesLogicHookFile = true;
copy($this->modulesHookFile, $this->modulesHookFile . '.bak');
} else {
write_array_to_file("test", array(), $this->modulesHookFile);
}
if (file_exists($this->contactsHookFile)) {
$this->hasCustomContactLogicHookFile = true;
copy($this->contactsHookFile, $this->contactsHookFile . '.bak');
} else {
write_array_to_file("test", array(), $this->contactsHookFile);
}
$this->useOutputBuffering = false;
LogicHook::refreshHooks();
}
示例5: setUp
public function setUp()
{
$this->bean = new Account();
Bug52113TestHook::$count = 0;
LogicHook::refreshHooks();
}