function ContactSitewideTestCase::updateCategory

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

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.