You are here

function ContactSitewideTestCase::deleteCategories in Contact 7.2

Same name and namespace in other branches
  1. 6.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 260
Tests for contact.module.

Class

ContactSitewideTestCase
@file Tests for contact.module.

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