function ContactSitewideTest::submitContact

Submits the contact form.

Parameters

string $name: The name of the sender.

string $mail: The e-mail address of the sender.

string $subject: The subject of the message.

string $id: The category ID of the message.

string $message: The message body.

2 calls to ContactSitewideTest::submitContact()
ContactSitewideTest::testAutoReply in drupal/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
Tests auto-reply on the site-wide contact form.
ContactSitewideTest::testSiteWideContact in drupal/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
Tests configuration options and the site-wide contact form.

File

drupal/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php, line 302
Definition of Drupal\contact\Tests\ContactSitewideTest.

Class

ContactSitewideTest
Tests the site-wide contact form.

Namespace

Drupal\contact\Tests

Code

function submitContact($name, $mail, $subject, $id, $message) {
  $edit = array();
  $edit['name'] = $name;
  $edit['mail'] = $mail;
  $edit['subject'] = $subject;
  $edit['message'] = $message;
  if ($id == config('contact.settings')
    ->get('default_category')) {
    $this
      ->drupalPost('contact', $edit, t('Send message'));
  }
  else {
    $this
      ->drupalPost('contact/' . $id, $edit, t('Send message'));
  }
}