You are here

function ContactSitewideTestCase::updateCategory in Contact 7.2

Same name and namespace in other branches
  1. 6.2 contact.test \ContactSitewideTestCase::updateCategory()

Update a category.

Parameters

string $category Name of category.:

string $recipients List of recipient e-mail addresses.:

string $reply Auto-reply text.:

boolean $selected Defautly selected.:

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

File

./contact.test, line 227
Tests for contact.module.

Class

ContactSitewideTestCase
@file Tests for contact.module.

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