diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 7e924805a7e5..1f518b974a70 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -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', @@ -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}' + "); } /**