6 * CRM_Pledge_Form_PledgeTest
10 class CRM_Pledge_Form_PledgeTest
extends CiviUnitTestCase
{
13 * Test the post process function.
15 * @throws \API_Exception
16 * @throws \CRM_Core_Exception
18 public function testPostProcess(): void
{
19 $mut = new CiviMailUtils($this);
20 $loggedInUser = $this->createLoggedInUser();
21 $this->addLocationBlockToDomain();
22 $this->swapMessageTemplateForInput('pledge_acknowledge', '{domain.name} {contact.first_name}');
24 $form = $this->getFormObject('CRM_Pledge_Form_Pledge', [
27 'contact_id' => $this->individualCreate(),
28 'is_acknowledge' => 1,
29 'start_date' => '2021-01-04',
30 'create_date' => '2021-01-04',
31 'from_email_address' => Email
::get()
32 ->addWhere('contact_id', '=', $loggedInUser)
33 ->addSelect('id')->execute()->first()['id'],
37 $mut->checkAllMailLog([
38 'Default Domain Name Anthony',
39 // These strings that are in the text template, since we swapped out the html one.
41 'fixme.domainemail@example.org',
44 $mut->clearMessages();
45 $this->revertTemplateToReservedTemplate('pledge_acknowledge');