function ContactSitewideTestCase::deleteCategories
Deletes all categories.
1 call to ContactSitewideTestCase::deleteCategories()
- ContactSitewideTestCase::testSiteWideContact in modules/
contact/ contact.test - Tests configuration options and the site-wide contact form.
File
-
modules/
contact/ contact.test, line 277
Class
- ContactSitewideTestCase
- Tests the site-wide contact form.
Code
function deleteCategories() {
$categories = $this->getCategories();
foreach ($categories as $category) {
$category_name = db_query("SELECT category FROM {contact} WHERE cid = :cid", array(
':cid' => $category,
))->fetchField();
$this->drupalPost('admin/structure/contact/delete/' . $category, array(), t('Delete'));
$this->assertRaw(t('Category %category has been deleted.', array(
'%category' => $category_name,
)), 'Category deleted successfully.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.