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