예제 #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());
 }