You are here

public function WebformTestCase::tearDown in Webform 7.3

Same name and namespace in other branches
  1. 6.3 tests/webform.test \WebformTestCase::tearDown()
  2. 6.2 tests/webform.test \WebformTestCase::tearDown()
  3. 7.4 tests/WebformTestCase.test \WebformTestCase::tearDown()

Implemenation of tearDown().

Overrides DrupalWebTestCase::tearDown

2 calls to WebformTestCase::tearDown()
WebformPermissionsTestCase::tearDown in tests/permissions.test
Implements hook.
WebformSubmissionTestCase::tearDown in tests/submission.test
Implements hook.
2 methods override WebformTestCase::tearDown()
WebformPermissionsTestCase::tearDown in tests/permissions.test
Implements hook.
WebformSubmissionTestCase::tearDown in tests/submission.test
Implements hook.

File

tests/webform.test, line 68
Webform module tests.

Class

WebformTestCase

Code

public function tearDown() {

  // Delete the webform admin and any created nodes.
  foreach ($this->webform_users as $account) {
    $uid = $account->uid;
    $result = db_select('node')
      ->fields('node')
      ->condition('uid', $uid)
      ->execute();
    foreach ($result as $node) {
      node_delete($node->nid);
    }
    user_cancel(array(), $uid, 'user_cancel_delete');
  }
  parent::tearDown();
}