Révision 8d02775b
Ajouté par Assos Assos il y a environ 4 ans
drupal7/sites/all/modules/webform/tests/WebformSubmissionTestCase.test | ||
---|---|---|
39 | 39 |
|
40 | 40 |
// Counting the anonymous submission doesn't work because |
41 | 41 |
// $_SESSION['webform_submission'] is not populated in testing. |
42 |
|
|
43 |
// Test _webform_submission_prepare_mail(). |
|
44 |
$node = node_load($this->webformForm()->nid); |
|
45 |
$submission = webform_get_submissions($node->nid); |
|
46 |
$submission = array_pop($submission); |
|
47 |
$email = array( |
|
48 |
'status' => TRUE, |
|
49 |
'html' => FALSE, |
|
50 |
'template' => 'default', |
|
51 |
'from_address' => 'Test From', |
|
52 |
'from_name' => 'from@example.com', |
|
53 |
'subject' => 'Test Subject', |
|
54 |
'email' => 'to@example.com', |
|
55 |
); |
|
56 |
variable_set('webform_email_replyto', TRUE); |
|
57 |
variable_set('webform_email_address_format', 'long'); |
|
58 |
variable_set('webform_default_from_name', 'Default "From" Name'); |
|
59 |
variable_set('webform_default_from_address', 'default-from@example.com'); |
|
60 |
$prepared_email = _webform_submission_prepare_mail($node, $submission, $email); |
|
61 |
$this->assertIdentical($prepared_email['mail_params']['email']['from'], '"from@example.com via Default \'From\' Name" <default-from@example.com>', 'From address is correctly set in _webform_submission_prepare_mail().'); |
|
42 | 62 |
} |
43 | 63 |
|
44 | 64 |
/** |
Formats disponibles : Unified diff
Weekly update of contrib modules