You are here

function TaxonomyEdgeTreeTestCase::testOrder in Taxonomy Edge 8

Same name and namespace in other branches
  1. 6 tests/tree.test \TaxonomyEdgeTreeTestCase::testOrder()
  2. 7 tests/tree.test \TaxonomyEdgeTreeTestCase::testOrder()

File

tests/tree.test, line 269

Class

TaxonomyEdgeTreeTestCase
@file

Code

function testOrder() {
  $valid_order = taxonomy_edge_is_order_valid($this->vocabulary->vid, TRUE);
  $this
    ->assertFALSE($valid_order, 'Order is invalid before sort');
  $invalid_order = taxonomy_edge_is_order_invalid($this->vocabulary->vid, TRUE);
  $this
    ->assertTRUE($invalid_order, 'At least one order is invalid before sort');
  $context = array();
  taxonomy_edge_rebuild_order($this->vocabulary->vid, $context);
  $valid_order = taxonomy_edge_is_order_valid($this->vocabulary->vid, TRUE);
  $this
    ->assertTRUE($valid_order, 'Order is valid after sort');
  $invalid_order = taxonomy_edge_is_order_invalid($this->vocabulary->vid, TRUE);
  $this
    ->assertFALSE($invalid_order, 'All orders are valid after sort');
  taxonomy_edge_invalidate_order($this->vocabulary->vid);
  $valid_order = taxonomy_edge_is_order_valid($this->vocabulary->vid, TRUE);
  $this
    ->assertFALSE($valid_order, 'Order is invalid after invalidation');
}