You are here

function ContactSitewideTestCase::updateCategory in Drupal 7

Updates 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.

1 call to ContactSitewideTestCase::updateCategory()
ContactSitewideTestCase::testSiteWideContact in modules/contact/contact.test
Tests configuration options and the site-wide contact form.

File

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

Class

ContactSitewideTestCase
Tests the site-wide contact form.

Code

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