示例#1
0
 public function testSpinTree()
 {
     $this->sample->createSpinTree();
     $spin1ftExt = $this->sample->getSpin1ftExt();
     $this->assertEquals($this->sample->getSpin1ft(), $spin1ftExt->getVariationOf());
     $this->assertEquals(4, count($spin1ftExt->getAncestors()));
     $root = $this->sample->getRootSkill();
     $this->assertEquals(7, count($root->getDescendents()));
     $spin1ft = $this->sample->getSpin1ft();
     $this->assertEquals(2, count($spin1ft->getVariations()));
 }
示例#2
0
 public function testSpinTree()
 {
     $this->sample->createSpinTree();
     $spin1ft = $this->sample->getSpin1ft();
     $root = $this->sample->getRootSkill();
     $calculator = new Calculator();
     $calculator->calculate($spin1ft);
     // importance
     $this->assertEquals(7, $root->getImportance());
     $this->assertEquals(2, $spin1ft->getImportance());
     // generation
     $this->assertEquals(1, $root->getGeneration());
     $this->assertEquals(4, $spin1ft->getGeneration());
     // lineage
     $this->assertEquals([1, 2, 3], $this->getLineageIds($spin1ft));
 }