You are here

function TaxonomyEdgeTreeTestCase::testInit in Taxonomy Edge 8

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

File

tests/tree.test, line 32

Class

TaxonomyEdgeTreeTestCase
@file

Code

function testInit() {
  $terms =& $this->terms;
  $vocabulary =& $this->vocabulary;
  $vid = $vocabulary->vid;
  $tree = $this
    ->formatTree();
  $expect = "test1\n- test2\n-- test3\n- test4\n-- test5\nsub1\nsub2\nsub3\n";
  $match = $tree == $expect;
  $message = "Tree initialized" . ($match ? "" : "\n<pre>Assumed:\n{$expect}\nGot:\n{$tree}");
  $this
    ->assertTRUE($match, $message);
}