示例#1
0
 public function testName()
 {
     $node = new TestNode();
     $this->assertSame('Vespolina\\Tests\\Workflow\\TestNode', $node->getName(), 'a missing name should return the class name');
     $node->setName('test node');
     $this->assertSame('test node', $node->getName(), 'the set name should be returned');
 }
    $a->addChildNode($e);
    $f = new TestNode();
    $f->setLabel('f');
    $a->addChildNode($f);
    $g = new TestNode();
    $g->setLabel('g');
    $a->addChildNode($g);
    $h = new TestNode();
    $h->setLabel('h');
    $a->addChildNode($h);
    $i = new TestNode();
    $i->setLabel('i');
    $a->addChildNode($i);
    $j = new TestNode();
    $j->setLabel('j');
    $a->addChildNode($j);
    $k = new TestNode();
    $k->setLabel('k');
    $a->addChildNode($k);
    echo "\ndescendants:\n";
    dumpTree($a);
    echo "\nRetrieving last node:\n";
    echo "-------------------------------------\n";
    $last = $a->getLastChildNode(true);
    echo "Last child node is '" . $last->getLabel() . "' (" . $last->getNodePath() . ")\n";
} catch (Exception $e) {
    die("Error creating tree with > 10 nodes: " . $e->__toString());
}
if (!isset($argc)) {
    echo "</pre>";
}