function ContactSitewideTest::addCategory

Adds a category.

Parameters

string $id: The category machine name.

string $label: The category label.

string $recipients: The list of recipient e-mail addresses.

string $reply: The auto-reply text that is sent to a user upon completing the contact form.

boolean $selected: A Boolean indicating whether the category should be selected by default.

2 calls to ContactSitewideTest::addCategory()
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 254
Definition of Drupal\contact\Tests\ContactSitewideTest.

Class

ContactSitewideTest
Tests the site-wide contact form.

Namespace

Drupal\contact\Tests

Code

function addCategory($id, $label, $recipients, $reply, $selected) {
  $edit = array();
  $edit['label'] = $label;
  $edit['id'] = $id;
  $edit['recipients'] = $recipients;
  $edit['reply'] = $reply;
  $edit['selected'] = $selected ? TRUE : FALSE;
  $this
    ->drupalPost('admin/structure/contact/add', $edit, t('Save'));
}