public function testNumChildren()
{
// start with root node only
$parent = NodeFactory::getInstance();
$this->assertEquals($parent->numChildren(), 0);
// add a child
$child = NodeFactory::getInstance();
$parent->addChild($child);
$this->assertEquals($parent->numChildren(), 1);
// add a direct grandchild, this one doesn't count as
// it's not enclosed in a CONTAINER
$child->addChild(NodeFactory::getInstance());
$this->assertEquals($parent->numChildren(), 1);
// add a container, this one doesn't count wither
$container = NodeFactory::getInstance('Node', 'default', Node::CONTAINER);
$parent->addChild($container);
$this->assertEquals($parent->numChildren(), 1);
// add a grandchild to container, this one counts
$container->addChild(NodeFactory::getInstance());
$this->assertEquals($parent->numChildren(), 2);
// add another grandchild to container, this one counts
$container->addChild(NodeFactory::getInstance());
$this->assertEquals($parent->numChildren(), 3);
}