Skip to content

Commit

Permalink
Add in unit test for dev/mailing#56 and dev/mailing#57 and also fix i…
Browse files Browse the repository at this point in the history
…ssue where by mailing_name has been namespaced also in 5.20
  • Loading branch information
seamuslee001 committed Nov 8, 2019
1 parent 3d46dfb commit 21b15dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 1 addition & 3 deletions CRM/Mailing/BAO/Mailing.php
Original file line number Diff line number Diff line change
Expand Up @@ -1839,9 +1839,7 @@ public static function &report($id, $skipDetails = FALSE, $isSMS = FALSE) {

$report['mailing'] = [];
foreach (array_keys(self::fields()) as $field) {
if ($field == 'mailing_modified_date') {
$field = 'modified_date';
}
$field = self::fields()[$field]['name'];
$report['mailing'][$field] = $mailing->$field;
}

Expand Down
6 changes: 6 additions & 0 deletions tests/phpunit/api/v3/JobProcessMailingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ public function testPauseAndResumeMailing() {
//Execute the job and it should send the mailing to the recipients now.
$this->callAPISuccess('job', 'process_mailing', []);
$this->_mut->assertRecipients($this->getRecipients(1, 2));
// Ensure that loading the report produces no errors.
$report = CRM_Mailing_BAO_Mailing::report($result['id']);
// dev/mailing#56 dev/mailing#57 Ensure that for completed mailings the jobs array is not empty.
$this->assertTrue(!empty($report['jobs']));
// Ensure that mailing name is correctly stored in the report.
$this->assertEuqals('mailing name', $report['name']);
}

/**
Expand Down

0 comments on commit 21b15dc

Please sign in to comment.