You are here

function ContactSitewideTestCase::addCategory in Drupal 7

Adds a category.

Parameters

string $category: The category name.

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: Boolean indicating whether the category should be selected by default.

2 calls to ContactSitewideTestCase::addCategory()
ContactSitewideTestCase::testAutoReply in modules/contact/contact.test
Tests auto-reply on the site-wide contact form.
ContactSitewideTestCase::testSiteWideContact in modules/contact/contact.test
Tests configuration options and the site-wide contact form.

File

modules/contact/contact.test, line 217
Tests for the Contact module.

Class

ContactSitewideTestCase
Tests the site-wide contact form.

Code

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