You are here

function OgTestCase::tearDown in Organic groups 5.2

Same name and namespace in other branches
  1. 5.8 tests/og_testcase.php \OgTestCase::tearDown()
  2. 5 tests/og_testcase.php \OgTestCase::tearDown()
  3. 5.3 tests/og_testcase.php \OgTestCase::tearDown()
  4. 5.7 tests/og_testcase.php \OgTestCase::tearDown()

tearDown implementation, setting back switched modules etc

Overrides DrupalTestCase::tearDown

File

tests/og_testcase.php, line 61

Class

OgTestCase

Code

function tearDown() {
  while (sizeof($this->_cleanupGroups) > 0) {
    $gid = array_pop($this->_cleanupGroups);
    node_delete($gid);
  }
  include_once './' . drupal_get_path('module', 'node') . '/content_types.inc';
  while (sizeof($this->_cleanupNodeTypes) > 0) {
    $name = array_pop($this->_cleanupNodeTypes);
    $types = variable_get('og_node_types', array());
    unset($types[$name]);
    variable_set('og_node_types', $types);
    node_type_delete_confirm_submit(0, array(
      'name' => $name,
      'type' => $name,
    ));
  }
  parent::tearDown();
}