Skip to content

Commit

Permalink
Fix some test cleanup routines
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Jun 24, 2023
1 parent f0cc324 commit b2b85a4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/phpunit/CiviTest/CiviUnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1777,6 +1777,7 @@ public function quickCleanUpFinancialEntities(): void {
'civicrm_membership_block',
'civicrm_event',
'civicrm_participant',
'civicrm_payment_processor',
'civicrm_participant_payment',
'civicrm_pledge',
'civicrm_pcp_block',
Expand Down Expand Up @@ -2645,16 +2646,15 @@ protected function swapMessageTemplateForTestTemplate($templateName = 'contribut
* @noinspection PhpDocMissingThrowsInspection
*/
protected function revertTemplateToReservedTemplate(string $templateName = 'contribution_online_receipt', string $type = 'html'): void {
CRM_Core_DAO::executeQuery(
"UPDATE civicrm_option_group og
LEFT JOIN civicrm_option_value ov ON ov.option_group_id = og.id
LEFT JOIN civicrm_msg_template m ON m.workflow_id = ov.id
LEFT JOIN civicrm_msg_template m2 ON m2.workflow_id = ov.id AND m2.is_reserved = 1
CRM_Core_DAO::executeQuery("
UPDATE civicrm_msg_template m
LEFT JOIN civicrm_msg_template m2
ON m2.workflow_name = m.workflow_name AND m2.is_reserved = 1
AND m.is_default = 1
AND m.msg_type = m2.msg_type
SET m.msg_{$type} = m2.msg_{$type}
WHERE og.name = 'msg_tpl_workflow_contribution'
AND ov.name = '{$templateName}'
AND m.is_default = 1"
);
WHERE m.workflow_name = '{$templateName}'
");
}

/**
Expand Down

0 comments on commit b2b85a4

Please sign in to comment.