|
| build (array $data, $node_id) |
|
◆ build()
ilStudyProgrammeProgressTreeTest::build |
( |
array |
$data, |
|
|
|
$node_id |
|
) |
| |
|
protected |
◆ setUp()
ilStudyProgrammeProgressTreeTest::setUp |
( |
| ) |
|
◆ testPGSTreeCreation()
ilStudyProgrammeProgressTreeTest::testPGSTreeCreation |
( |
| ) |
|
Definition at line 68 of file ilStudyProgrammeProgressTreeTest.php.
71 $this->assertEquals($n->getId(),
'top');
72 $this->assertInstanceOf(Node::class, $n->getSubnode(
'1.1'));
75 [
'top',
'1.2',
'1.2.2'],
76 $n->getSubnode(
'1.2')->getSubnode(
'1.2.2')->getPath()
80 [
'top',
'1.2',
'1.2.1'],
81 $n->findSubnodePath(
'1.2.1')
◆ testPGSTreeZipperManipulateAll()
ilStudyProgrammeProgressTreeTest::testPGSTreeZipperManipulateAll |
( |
| ) |
|
Definition at line 128 of file ilStudyProgrammeProgressTreeTest.php.
130 $zipper =
new Zipper($this->topnode);
132 ->modifyAll(fn($n) => $n->withScore(count($n->getSubnodes())))
135 $this->assertEquals(2, $modified->getScore());
136 $this->assertEquals(0, $modified->getSubnode(
'1.1')->getScore());
137 $this->assertEquals(2, $modified->getSubnode(
'1.2')->getScore());
138 $this->assertEquals(1, $modified->getSubnode(
'1.2')->getSubnode(
'1.2.1')->getScore());
139 $this->assertEquals(0, $modified->getSubnode(
'1.2')->getSubnode(
'1.2.1')->getSubnode(
'1.2.1.1')->getScore());
140 $this->assertEquals(0, $modified->getSubnode(
'1.2')->getSubnode(
'1.2.2')->getScore());
◆ testPGSTreeZipperManipulation()
ilStudyProgrammeProgressTreeTest::testPGSTreeZipperManipulation |
( |
| ) |
|
Definition at line 99 of file ilStudyProgrammeProgressTreeTest.php.
References $path.
101 $zipper =
new Zipper($this->topnode);
103 $path = $this->topnode->findSubnodePath(
'1.2.1');
105 ->toPath(
$path)->modifyFocus(fn($n) => $n->withScore(7))
106 ->toParent()->modifyFocus(fn($n) => $n->withScore(6))
109 $zipper =
new Zipper($modified);
110 $other_path = $this->topnode->findSubnodePath(
'1.1');
112 ->toPath($other_path)->modifyFocus(fn($n) => $n->withScore(8))
114 $this->assertEquals(7, $modified->getSubnode(
'1.2')->getSubnode(
'1.2.1')->getScore());
115 $this->assertEquals(6, $modified->getSubnode(
'1.2')->getScore());
116 $this->assertEquals(8, $modified->getSubnode(
'1.1')->getScore());
119 $zipper =
new Zipper($modified);
121 ->toPath(
$path)->modifyFocus(fn($n) => $n->withScore(17))
123 $this->assertEquals(17, $modified->getSubnode(
'1.2')->getSubnode(
'1.2.1')->getScore());
124 $this->assertEquals(6, $modified->getSubnode(
'1.2')->getScore());
125 $this->assertEquals(8, $modified->getSubnode(
'1.1')->getScore());
◆ testPGSTreeZipperNav()
ilStudyProgrammeProgressTreeTest::testPGSTreeZipperNav |
( |
| ) |
|
Definition at line 85 of file ilStudyProgrammeProgressTreeTest.php.
87 $zipper =
new Zipper($this->topnode);
88 $this->assertInstanceOf(Zipper::class, $zipper->toChild(
'1.1'));
89 $this->assertInstanceOf(
91 $zipper->toPath($this->topnode->findSubnodePath(
'1.2.1'))->toParent()
93 $this->assertInstanceOf(
95 $zipper->toPath($this->topnode->findSubnodePath(
'1.2.1'))->getRoot()
◆ $topnode
NodeMock ilStudyProgrammeProgressTreeTest::$topnode |
|
protected |
The documentation for this class was generated from the following file: