1 contact.test ContactSitewideTestCase::updateCategory($categories, $category, $recipients, $reply, $selected)

Updates a category.

Parameters

string $category: The category name.

string $recipients: The list of recipient email 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.

File

core/modules/contact/tests/contact.test, line 258
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->backdropPost('admin/structure/contact/configure/' . $category_id, $edit, t('Save'));
  return ($category_id);
}