ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
SkillProfileTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Skill\Profile;
22
23use PHPUnit\Framework\TestCase;
24
28class SkillProfileTest extends TestCase
29{
35
36 protected function setUp(): void
37 {
38 parent::setUp();
39
40 $this->profile = new SkillProfile(
41 11,
42 "My profile",
43 "This is my profile",
44 12,
45 "my_profile_image_id"
46 );
47 $this->profile_level = new SkillProfileLevel(
48 21,
49 22,
50 23,
51 24,
52 25
53 );
54 $this->profile_completion = new SkillProfileCompletion(
55 31,
56 32,
57 "1999-01-01 12:12:12",
58 true
59 );
60 $this->profile_user_assignment = new SkillProfileUserAssignment(
61 "My user",
62 41
63 );
64 $this->profile_role_assignment = new SkillProfileRoleAssignment(
65 "My role",
66 51,
67 "My object",
68 "My object type",
69 52
70 );
71 }
72
73 public function testProfileProperties(): void
74 {
75 $p = $this->profile;
76
77 $this->assertEquals(
78 11,
79 $p->getId()
80 );
81 $this->assertEquals(
82 "My profile",
83 $p->getTitle()
84 );
85 $this->assertEquals(
86 "This is my profile",
87 $p->getDescription()
88 );
89 $this->assertEquals(
90 12,
91 $p->getSkillTreeId()
92 );
93 $this->assertEquals(
94 "my_profile_image_id",
95 $p->getImageId()
96 );
97 $this->assertEquals(
98 0,
99 $p->getRefId()
100 );
101 }
102
103 public function testProfileLevelProperties(): void
104 {
106
107 $this->assertEquals(
108 21,
109 $pl->getProfileId()
110 );
111 $this->assertEquals(
112 22,
113 $pl->getBaseSkillId()
114 );
115 $this->assertEquals(
116 23,
117 $pl->getTrefId()
118 );
119 $this->assertEquals(
120 24,
121 $pl->getLevelId()
122 );
123 $this->assertEquals(
124 25,
125 $pl->getOrderNr()
126 );
127 }
128
129 public function testProfileCompletionProperties(): void
130 {
132
133 $this->assertEquals(
134 31,
135 $pc->getProfileId()
136 );
137 $this->assertEquals(
138 32,
139 $pc->getUserId()
140 );
141 $this->assertEquals(
142 "1999-01-01 12:12:12",
143 $pc->getDate()
144 );
145 $this->assertEquals(
146 true,
147 $pc->getFulfilled()
148 );
149 }
150
152 {
154
155 $this->assertEquals(
156 "user",
157 $pu->getType()
158 );
159 $this->assertEquals(
160 "My user",
161 $pu->getName()
162 );
163 $this->assertEquals(
164 41,
165 $pu->getId()
166 );
167 }
168
170 {
172
173 $this->assertEquals(
174 "role",
175 $pr->getType()
176 );
177 $this->assertEquals(
178 "My role",
179 $pr->getName()
180 );
181 $this->assertEquals(
182 51,
183 $pr->getId()
184 );
185 $this->assertEquals(
186 "My object",
187 $pr->getObjTitle()
188 );
189 $this->assertEquals(
190 "My object type",
191 $pr->getObjType()
192 );
193 $this->assertEquals(
194 52,
195 $pr->getObjId()
196 );
197 }
198
200 {
203
204 $this->assertInstanceOf(SkillProfileAssignmentInterface::class, $pu);
205 $this->assertInstanceOf(SkillProfileAssignmentInterface::class, $pr);
206 }
207}
SkillProfileUserAssignment $profile_user_assignment
SkillProfileCompletion $profile_completion
SkillProfileRoleAssignment $profile_role_assignment