From 7d04a4b497b194a1994c3d0a8765ef05542c1dda Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 19 Oct 2021 09:14:09 +1300 Subject: [PATCH] Add test for selvsvctransfer, remove from template --- .../CRM/Event/Form/SelfSvcTransferTest.php | 34 +++++++++++++++++++ .../participant_transferred_html.tpl | 4 +-- 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 tests/phpunit/CRM/Event/Form/SelfSvcTransferTest.php diff --git a/tests/phpunit/CRM/Event/Form/SelfSvcTransferTest.php b/tests/phpunit/CRM/Event/Form/SelfSvcTransferTest.php new file mode 100644 index 0000000000..5901112a76 --- /dev/null +++ b/tests/phpunit/CRM/Event/Form/SelfSvcTransferTest.php @@ -0,0 +1,34 @@ +participantCreate(['status_id' => 'Registered']); + $_REQUEST['is_backoffice'] = 1; + $this->individualCreate(['email' => 'new@example.org']); + $mut = new CiviMailUtils($this); + /* @var CRM_Event_Form_SelfSvcTransfer $form*/ + $form = $this->getFormObject('CRM_Event_Form_SelfSvcTransfer', [ + 'email' => 'new@example.org', + ]); + $form->buildForm(); + $form->postProcess(); + $emails = $mut->getAllMessages(); + $this->assertStringContainsString('Registration Confirmation - Annual CiviCRM meet - Mr. Anthony', $emails[0]); + $this->assertStringContainsString('

Dear Anthony,

Your Event Registration has been Transferred to Anthony Anderson.

', $emails[1]); + $this->assertStringContainsString('anthony_anderson@civicrm.org', $emails[1]); + } + +} diff --git a/xml/templates/message_templates/participant_transferred_html.tpl b/xml/templates/message_templates/participant_transferred_html.tpl index 5ae769e2db..fa066e1b8e 100644 --- a/xml/templates/message_templates/participant_transferred_html.tpl +++ b/xml/templates/message_templates/participant_transferred_html.tpl @@ -87,7 +87,7 @@ {/foreach} {/if} - {if $contact.email} + {if '{contact.email}'} {ts}Registered Email{/ts} @@ -95,7 +95,7 @@ - {$contact.email} + {contact.email} {/if} -- 2.25.1