function ContactSitewideTestCase::deleteCategories

Deletes all categories.

2 calls to ContactSitewideTestCase::deleteCategories()
ContactSitewideTestCase::testSiteWideContact in drupal-7.x/modules/contact/contact.test
Tests configuration options and the site-wide contact form.
ContactSitewideTestCase::testSiteWideContact in drupal-7.x/modules/contact/contact.test
Tests configuration options and the site-wide contact form.

Archivo

drupal-7.x/modules/contact/contact.test, line 277
Tests for the Contact module.

Class

ContactSitewideTestCase
Tests the site-wide contact form.

Código

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.');
  }
}