You are here

public function TaxonomyMenuFunctionalTest::testTaxonomyMenuTermsOverviewInterface in Taxonomy menu 7.2

Re-order terms on the terms' overview page.

File

tests/taxonomy_menu.test, line 223
Defines abstract base test class for the Taxonomy menu module tests.

Class

TaxonomyMenuFunctionalTest
Tests the taxonomy vocabulary interface.

Code

public function testTaxonomyMenuTermsOverviewInterface() {
  $term7 = $this->terms_hierarchy[7];

  // last term of our hierarchy.
  // Submit the main taxonomy administration page.
  $edit = array(
    'taxonomy_menu[vocab_parent]' => 'main-menu:0',
    'taxonomy_menu[sync]' => TRUE,
  );
  $this
    ->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->machine_name . '/edit', $edit, t('Save'));

  // Visit the terms overview page.
  $this
    ->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->machine_name);

  // Take last term, place it on top and save.
  $edit = array(
    'tid:' . $term7->tid . ':0[tid]' => $term7->tid,
    'tid:' . $term7->tid . ':0[parent]' => 0,
    'tid:' . $term7->tid . ':0[depth]' => 0,
    'tid:' . $term7->tid . ':0[weight]' => -5,
  );
  $this
    ->drupalPost(NULL, $edit, t('Save'));
  $this
    ->assertRaw(t('The Taxonomy menu has been updated.'));

  // Test "Reset to alphabetical".
  $this
    ->drupalPost('admin/structure/taxonomy/' . $this->vocabulary->machine_name, array(), t('Reset to alphabetical'));
  $this
    ->drupalPost(NULL, array(), t('Reset to alphabetical'));
  $this
    ->assertRaw(t('The Taxonomy menu has been updated.'));
}