Exemple #1
0
 /**
  * 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.');
 }
Exemple #2
0
 public function testIsRootNode()
 {
     $node = new Node(Tree::ROOT_NODE_ID);
     $this->assertTrue($node->isRoot());
 }