TestCase for SPRG-Section of dashboard.
More...
TestCase for SPRG-Section of dashboard.
Definition at line 25 of file ilStudyProgrammeDashGUITest.php.
◆ setUp()
ilStudyProgrammeDashGUITest::setUp |
( |
| ) |
|
|
protected |
◆ testPercentageWithCoursesAtTopLevel()
ilStudyProgrammeDashGUITest::testPercentageWithCoursesAtTopLevel |
( |
int |
$current_user_points | ) |
|
userPointsDataProvider
Definition at line 73 of file ilStudyProgrammeDashGUITest.php.
75 $this->prg->method(
'hasLPChildren')
78 list($minimum_percents, $current_percents)
79 = $this->gui->mockCalculatePercent($this->prg, $current_user_points);
81 $this->assertEquals(100, $minimum_percents);
82 if ($current_user_points == 0) {
83 $this->assertEquals(0, $current_percents);
85 if ($current_user_points > 0) {
86 $this->assertEquals(100, $current_percents);
◆ testPercentageWithoutChildren()
ilStudyProgrammeDashGUITest::testPercentageWithoutChildren |
( |
int |
$current_user_points | ) |
|
userPointsDataProvider
Definition at line 56 of file ilStudyProgrammeDashGUITest.php.
58 $this->prg->method(
'hasLPChildren')
60 $this->prg->method(
'getAllPrgChildren')
63 list($minimum_percents, $current_percents)
64 = $this->gui->mockCalculatePercent($this->prg, $current_user_points);
66 $this->assertEquals(0, $minimum_percents);
67 $this->assertEquals(0, $current_percents);
◆ testPercentageWithPrograms()
ilStudyProgrammeDashGUITest::testPercentageWithPrograms |
( |
int |
$current_user_points, |
|
|
float |
$expected |
|
) |
| |
userPointsDataProvider
Definition at line 93 of file ilStudyProgrammeDashGUITest.php.
95 $node = $this->getMockBuilder(ilObjStudyProgramme::class)
96 ->disableOriginalConstructor()
97 ->setMethods([
'getPoints'])
100 $node1 = clone $node;
101 $node1->method(
'getPoints')->willReturn(100);
102 $node2 = clone $node;
103 $node2->method(
'getPoints')->willReturn(50);
104 $node3 = clone $node;
105 $node3->method(
'getPoints')->willReturn(5);
106 $node4 = clone $node;
107 $node4->method(
'getPoints')->willReturn(5);
109 $this->prg->method(
'hasLPChildren')
111 $this->prg->method(
'getAllPrgChildren')
112 ->willReturn([$node1, $node2, $node3, $node4]);
114 $this->prg->method(
'getPoints')->willReturn(60);
116 list($minimum_percents, $current_percents)
117 = $this->gui->mockCalculatePercent($this->prg, $current_user_points);
119 $this->assertEquals(37.5, $minimum_percents);
120 $this->assertEquals($expected, $current_percents);
◆ userPointsDataProvider()
ilStudyProgrammeDashGUITest::userPointsDataProvider |
( |
| ) |
|
Definition at line 40 of file ilStudyProgrammeDashGUITest.php.
46 'fiftyfive' => [55, 34.38],
47 'hundred' => [100, 62.5],
48 'oneOone' => [101, 63.13],
49 'onesixty' => [160, 100]
The documentation for this class was generated from the following file: