-
-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev/core/#/229 Fix fatal error on send test mail #12399
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -398,7 +398,7 @@ public function testMailerPreviewRecipientsDeduplicateAndOnholdEmails() { | |
} | ||
|
||
/** | ||
* | ||
* Test sending a test mailing. | ||
*/ | ||
public function testMailerSendTest_email() { | ||
$contactIDs['alice'] = $this->individualCreate(array( | ||
|
@@ -410,8 +410,10 @@ public function testMailerSendTest_email() { | |
$mail = $this->callAPISuccess('mailing', 'create', $this->_params); | ||
|
||
$params = array('mailing_id' => $mail['id'], 'test_email' => 'alice@example.org', 'test_group' => NULL); | ||
// Per https://lab.civicrm.org/dev/core/issues/229 ensure this is not passed through! | ||
$params['id'] = $mail['id']; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eileenmcnaughton how has this test been passing is it just that there isn't a difference in ids between the civicrm_mailing table the civicrm_mailing_job table here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @seamuslee001 I was able to replicate it when I added to the test so it wasn't transposing 'mailing_id' to 'id' in the api wrapper (I haven't fully thought that through) - in the api 'id' refers to mailing_id - but is passed to MailingJob as if it were MailingJob id - hence the bug There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (mailing id is supposed to be required here & it makes sense it should be) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm interesting. So the test was succeeding in that it was setting a mailing_id but no id but once the id got set then it started failing is that the case? |
||
$deliveredInfo = $this->callAPISuccess($this->_entity, 'send_test', $params); | ||
$this->assertEquals(1, $deliveredInfo['count'], "in line " . __LINE__); // verify mail has been sent to user by count | ||
$this->assertEquals(1, $deliveredInfo['count']); // verify mail has been sent to user by count | ||
|
||
$deliveredContacts = array_values(CRM_Utils_Array::collect('contact_id', $deliveredInfo['values'])); | ||
$this->assertEquals(array($contactIDs['alice']), $deliveredContacts); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused