You are here

function ContactSitewideTestCase::deleteCategories in Contact 6.2

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

Delete all categories.

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

File

./contact.test, line 253

Class

ContactSitewideTestCase
Test the sitewide 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,
    )), t('Category deleted sucessfully.'));
  }
}