Commit | Line | Data |
---|---|---|
66125803 TO |
1 | <?php |
2 | ||
9d7f4cd2 | 3 | class CRM_Contribute_WorkflowMessage_RecurringEdit_AlexCancelled extends \Civi\WorkflowMessage\WorkflowMessageExample { |
66125803 TO |
4 | |
5 | public function getExamples(): iterable { | |
6 | yield [ | |
7 | 'name' => "workflow/{$this->wfName}/{$this->exName}", | |
8 | // This title is not very clear. When we have some more examples to compare against, feel free to change/clarify. | |
9d7f4cd2 | 9 | 'title' => ts('Recurring Edit: Alex, Cancelled'), |
66125803 TO |
10 | 'tags' => ['preview', 'phpunit'], |
11 | ]; | |
12 | } | |
13 | ||
14 | public function build(array &$example): void { | |
15 | $msg = (new CRM_Contribute_WorkflowMessage_RecurringEdit()) | |
16 | ->setContact(\Civi\Test::example('entity/Contact/Alex')) | |
17 | ->setContributionRecur(\Civi\Test::example('entity/ContributionRecur/Euro5990/cancelled')); | |
18 | $example['data'] = $this->toArray($msg); | |
19 | ||
20 | $example['asserts'] = [ | |
21 | 'default' => [ | |
22 | ['for' => 'subject', 'regex' => '/Recurring Contribution Update.*Alex/'], | |
f70a513f | 23 | ['for' => 'text', 'regex' => '/Recurring contribution is for €5,990.99, every 2 year.s. for 24 installments/'], |
66125803 TO |
24 | ], |
25 | ]; | |
26 | } | |
27 | ||
28 | } |