3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | Use of this source code is governed by the AGPL license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * Class CRM_Contribute_Form_UpdateSubscriptionTest
15 class CRM_Contribute_Form_CancelSubscriptionTest
extends CRM_Contribute_Form_RecurForms
{
18 * Test the mail sent on update.
20 * @throws \CRM_Core_Exception|\API_Exception
22 public function testMail(): void
{
23 $mut = new CiviMailUtils($this, TRUE);
24 $this->addContribution();
25 /* @var CRM_Contribute_Form_CancelSubscription $form */
26 $form = $this->getFormObject('CRM_Contribute_Form_CancelSubscription', ['is_notify' => TRUE]);
27 $form->set('crid', $this->getContributionRecurID());
32 catch (CRM_Core_Exception_PrematureExitException
$e) {
33 $mut->checkMailLog($this->getExpectedMailStrings());
36 $this->fail('should not be reachable');
40 * Get the strings to check for.
44 public function getExpectedMailStrings(): array {
47 'From: "Bob" <bob@example.org>',
48 'To: Anthony Anderson <anthony_anderson@civicrm.org>',
49 "Subject: Recurring Contribution Cancellation Notification - Mr. Anthony\n Anderson II",
50 'Return-Path: bob@example.org',
52 'Your recurring contribution of $ 10.00, every 1 month has been cancelled as requested',