示例#1
0
 public function testRoot()
 {
     // test with only one tree
     $this->baobab->appendChild();
     $this->assertTrue(1 === $this->baobab->getRoot());
     // add a couple more trees
     Baobab::cleanAll(self::$db, self::$forest_name);
     $tree_a = '[{
         "fields":["tree_id","id","lft","rgt"],
         "values":[1,1,1,2,[]]
         }]';
     Baobab::import(self::$db, self::$forest_name, $tree_a);
     $this->baobab->appendChild();
     $this->_fillAnyIdTree(2);
     $this->assertTrue(2 === $this->baobab->getRoot());
 }