ContactEmailsDefaultEmailTest.php in Contact Emails 8
File
src/Tests/ContactEmailsDefaultEmailTest.php
View source
<?php
namespace Drupal\contact_emails\Tests;
use Drupal\contact_emails\ContactEmailsTestBase;
class ContactEmailsDefaultEmailTest extends ContactEmailsTestBase {
public static $modules = [
'contact',
'contact_storage',
'contact_emails',
'contact_emails_test_mail_alter',
];
public function testSendEmail() {
$params = [
'subject[0][value]' => 'Contact Emails Test Form Subject',
'message[0][value]' => 'Contact Emails Test Form Body',
'recipient_type[0][value]' => 'default',
'reply_to_type[0][value]' => 'default',
'status[value]' => TRUE,
];
$this
->drupalPostForm('/admin/structure/contact/manage/contact_emails_test_form/emails/add', $params, t('Save'));
$params = [
'subject[0][value]' => 'Submission Test Form Subject',
'message[0][value]' => 'Submission Test Form Body',
];
$this
->drupalPostForm('/contact/contact_emails_test_form', $params, t('Send message'));
$this
->assertText('Your message has been sent.', 'Message sent successfully.');
$this
->assertText('Contact Emails Test Form Subject', 'Message subject set successfully.');
$this
->assertText('Contact Emails Test Form Body', 'Message body set successfully.');
}
}