19 declare(strict_types=1);
31 $repo = $this->getMockBuilder(SkillProfileCompletionDBRepository::class)->disableOriginalConstructor()->getMock();
40 public function getActualMaxLevels(
43 string $gap_mode =
"",
44 string $gap_mode_type =
"",
45 int $gap_mode_obj_id = 0
49 if ($user_id === 101) {
50 $actual_levels[301][0] = 501;
51 $actual_levels[302][0] = 504;
52 $actual_levels[303][0] = 503;
53 $actual_levels[304][0] = 502;
54 $actual_levels[305][0] = 502;
55 } elseif ($user_id === 102) {
56 $actual_levels[301][0] = 505;
57 $actual_levels[302][0] = 505;
58 $actual_levels[303][0] = 505;
59 $actual_levels[304][0] = 505;
60 $actual_levels[305][0] = 505;
61 } elseif ($user_id === 103) {
62 $actual_levels[301][0] = 505;
63 $actual_levels[302][0] = 501;
64 $actual_levels[303][0] = 505;
65 $actual_levels[304][0] = 501;
66 $actual_levels[305][0] = 501;
67 } elseif ($user_id === 104) {
68 $actual_levels[301][0] = 505;
69 $actual_levels[305][0] = 501;
70 } elseif ($user_id === 105) {
74 return $actual_levels;
81 $p_repo = $this->getMockBuilder(SkillProfileDBRepository::class)->disableOriginalConstructor()->getMock();
82 $pl_repo = $this->getMockBuilder(SkillProfileLevelsDBRepository::class)->disableOriginalConstructor()->getMock();
83 $pu_repo = $this->getMockBuilder(SkillProfileUserDBRepository::class)->disableOriginalConstructor()->getMock();
84 $pr_repo = $this->getMockBuilder(SkillProfileRoleDBRepository::class)->disableOriginalConstructor()->getMock();
95 public function getSkillLevels(
int $profile_id): array
99 if ($profile_id > 0) {
116 $this->assertSame(0, $manager->getProfileProgress(101, 201));
117 $this->assertSame(100, $manager->getProfileProgress(102, 201));
118 $this->assertSame(40, $manager->getProfileProgress(103, 201));
119 $this->assertSame(20, $manager->getProfileProgress(104, 201));
120 $this->assertSame(0, $manager->getProfileProgress(105, 201));
121 $this->assertSame(0, $manager->getProfileProgress(101, 0));
122 $this->assertSame(0, $manager->getProfileProgress(0, 201));
123 $this->assertSame(0, $manager->getProfileProgress(0, 0));
__construct()
Constructor setup ILIAS global object public.
Repository for skill profile completion.
Manages skill profile completion.