示例#1
0
文件: Tree.php 项目: tebru/tree
 /**
  * Will throw an exception if the node is a root node
  *
  * @param Node $node
  *
  * @throws Exception\OperationNotAllowedException
  */
 private function assertIsNotRoot(Node $node)
 {
     if (!$node->isRoot()) {
         return;
     }
     throw new OperationNotAllowedException('Could not perform operation on root node.');
 }
示例#2
0
文件: NodeTest.php 项目: tebru/tree
 public function testIsRootNode()
 {
     $node = new Node(Tree::ROOT_NODE_ID);
     $this->assertTrue($node->isRoot());
 }