You are here

function TaxonomyMenuUnitTest::testTaxonomyMenuCRUD in Taxonomy menu 7

Same name and namespace in other branches
  1. 7.2 tests/taxonomy_menu.test \TaxonomyMenuUnitTest::testTaxonomyMenuCRUD()

File

./taxonomy_menu.test, line 86
Tests for taxonomy_menu.module.

Class

TaxonomyMenuUnitTest
Tests for taxonomy vocabulary functions.

Code

function testTaxonomyMenuCRUD() {
  $edit = array();
  $edit['taxonomy_menu[vocab_parent]'] = 'main-menu:0';
  $this
    ->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->machine_name . '/edit', $edit, 'Save');
  $this
    ->assertResponse(200);
  $term = $this->term;
  $this
    ->assertLink($term->name);
  $term = $this->term;
  taxonomy_term_delete($term->tid);
  $this
    ->drupalGet('<front>');
  $this
    ->assertNoLink($term->name);
  $node = $this
    ->drupalCreateNode();
  $this
    ->drupalPost("node/{$node->nid}/delete", array(), t('Delete'));
  $this
    ->drupalGet("node/{$node->nid}");
  $this
    ->assertResponse(404);
}