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