ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilStudyProgrammeProgressTest Class Reference
+ Inheritance diagram for ilStudyProgrammeProgressTest:
+ Collaboration diagram for ilStudyProgrammeProgressTest:

Public Member Functions

 test_init_and_id ()
 
 test_assignment_id ()
 @depends test_init_and_id More...
 
 test_node_id ()
 @depends test_init_and_id More...
 
 test_user_id ()
 @depends test_init_and_id More...
 
 test_amount_of_points ()
 @depends test_init_and_id More...
 
 test_amount_of_points_invalid ()
 @depends test_init_and_id More...
 
 test_current_amount_of_points ()
 @depends test_init_and_id More...
 
 status ()
 
 test_status ($status)
 @dataProvider status More...
 
 test_status_invalid ()
 @depends test_init_and_id More...
 
 test_completion_by ()
 @depends test_init_and_id More...
 
 test_last_change_by ()
 @depends test_init_and_id More...
 
 test_last_change_by_invalid ()
 @depends test_init_and_id More...
 
 test_last_change_by_null ()
 @depends test_init_and_id More...
 
 test_assignment_date ()
 @depends test_init_and_id More...
 
 test_completion_date ()
 @depends test_init_and_id More...
 
 test_deadline ()
 @depends test_init_and_id More...
 
 test_vq_date ()
 @depends test_init_and_id More...
 
 test_invalidate ()
 @depends test_vq_date More...
 
 test_invalidate_non_expired_1 ()
 @depends test_vq_date More...
 
 test_invalidate_non_expired_2 ()
 @depends test_vq_date More...
 

Detailed Description

Definition at line 3 of file ilStudyProgrammeProgressTest.php.

Member Function Documentation

◆ status()

◆ test_amount_of_points()

ilStudyProgrammeProgressTest::test_amount_of_points ( )

@depends test_init_and_id

Definition at line 42 of file ilStudyProgrammeProgressTest.php.

43 {
44 $spp = (new ilStudyProgrammeProgress(123))->setAmountOfPoints(321);
45 $this->assertEquals($spp->getAmountOfPoints(), 321);
46 }
Class ilStudyProgrammeProgress.

◆ test_amount_of_points_invalid()

ilStudyProgrammeProgressTest::test_amount_of_points_invalid ( )

@depends test_init_and_id

Definition at line 51 of file ilStudyProgrammeProgressTest.php.

52 {
53 $this->expectException(\ilException::class);
54 $spp = (new ilStudyProgrammeProgress(123))->setAmountOfPoints(-321);
55 }

◆ test_assignment_date()

ilStudyProgrammeProgressTest::test_assignment_date ( )

@depends test_init_and_id

Definition at line 134 of file ilStudyProgrammeProgressTest.php.

135 {
136 $ad = new DateTime();
137 $spp = (new ilStudyProgrammeProgress(123))->setAssignmentDate($ad);
138 $this->assertEquals($spp->getAssignmentDate()->format('Y-m-d'), $ad->format('Y-m-d'));
139 }

◆ test_assignment_id()

ilStudyProgrammeProgressTest::test_assignment_id ( )

@depends test_init_and_id

Definition at line 15 of file ilStudyProgrammeProgressTest.php.

16 {
17 $spp = (new ilStudyProgrammeProgress(123))->setAssignmentId(321);
18 $this->assertEquals($spp->getAssignmentId(), 321);
19 }

◆ test_completion_by()

ilStudyProgrammeProgressTest::test_completion_by ( )

@depends test_init_and_id

Definition at line 98 of file ilStudyProgrammeProgressTest.php.

99 {
100 $spp = (new ilStudyProgrammeProgress(123))->setCompletionBy(321);
101 $this->assertEquals($spp->getCompletionBy(), 321);
102 }

◆ test_completion_date()

ilStudyProgrammeProgressTest::test_completion_date ( )

@depends test_init_and_id

Definition at line 144 of file ilStudyProgrammeProgressTest.php.

145 {
146 $cd = new DateTime();
147 $spp = (new ilStudyProgrammeProgress(123))->setCompletionDate($cd);
148 $this->assertEquals($spp->getCompletionDate()->format('Y-m-d'), $cd->format('Y-m-d'));
149 $spp = (new ilStudyProgrammeProgress(123))->setCompletionDate(null);
150 $this->assertNull($spp->getCompletionDate());
151 }

◆ test_current_amount_of_points()

ilStudyProgrammeProgressTest::test_current_amount_of_points ( )

@depends test_init_and_id

Definition at line 60 of file ilStudyProgrammeProgressTest.php.

61 {
62 $spp = (new ilStudyProgrammeProgress(123))->setCurrentAmountOfPoints(321);
63 $this->assertEquals($spp->getCurrentAmountOfPoints(), 321);
64 }

◆ test_deadline()

ilStudyProgrammeProgressTest::test_deadline ( )

@depends test_init_and_id

Definition at line 156 of file ilStudyProgrammeProgressTest.php.

157 {
158 $dl = new DateTime();
159 $spp = (new ilStudyProgrammeProgress(123))->setDeadline($dl);
160 $this->assertEquals($spp->getDeadline()->format('Y-m-d'), $dl->format('Y-m-d'));
161 }

◆ test_init_and_id()

ilStudyProgrammeProgressTest::test_init_and_id ( )

Definition at line 5 of file ilStudyProgrammeProgressTest.php.

6 {
7 $spp = new ilStudyProgrammeProgress(123);
8 $this->assertEquals($spp->getId(), 123);
9 return $spp;
10 }

◆ test_invalidate()

ilStudyProgrammeProgressTest::test_invalidate ( )

@depends test_vq_date

Definition at line 176 of file ilStudyProgrammeProgressTest.php.

177 {
178 $spp = new ilStudyProgrammeProgress(123);
179 $this->assertFalse($spp->isInvalidated());
180 $past = DateTime::createFromFormat('Ymd', '20180101');
181 $spp->setValidityOfQualification($past);
182 $spp->invalidate();
183 $this->assertTrue($spp->isInvalidated());
184 }

◆ test_invalidate_non_expired_1()

ilStudyProgrammeProgressTest::test_invalidate_non_expired_1 ( )

@depends test_vq_date

Definition at line 189 of file ilStudyProgrammeProgressTest.php.

190 {
191 $this->expectException(\ilException::class);
192 $tomorrow = new DateTime();
193 $tomorrow->add(new DateInterval('P1D'));
194 $spp = (new ilStudyProgrammeProgress(123))->setValidityOfQualification($tomorrow)->invalidate();
195 }

◆ test_invalidate_non_expired_2()

ilStudyProgrammeProgressTest::test_invalidate_non_expired_2 ( )

@depends test_vq_date

Definition at line 200 of file ilStudyProgrammeProgressTest.php.

201 {
202 $this->expectException(\ilException::class);
203 $spp = (new ilStudyProgrammeProgress(123))->invalidate();
204 }

◆ test_last_change_by()

ilStudyProgrammeProgressTest::test_last_change_by ( )

@depends test_init_and_id

Definition at line 107 of file ilStudyProgrammeProgressTest.php.

108 {
109 $spp = (new ilStudyProgrammeProgress(123))->setLastChangeBy(6);
110 $this->assertEquals($spp->getLastChangeBy(), 6);
111 }

◆ test_last_change_by_invalid()

ilStudyProgrammeProgressTest::test_last_change_by_invalid ( )

@depends test_init_and_id

Definition at line 116 of file ilStudyProgrammeProgressTest.php.

117 {
118 $this->expectException(\ilException::class);
119 $spp = (new ilStudyProgrammeProgress(123))->setLastChangeBy(-1);
120 }

◆ test_last_change_by_null()

ilStudyProgrammeProgressTest::test_last_change_by_null ( )

@depends test_init_and_id

Definition at line 125 of file ilStudyProgrammeProgressTest.php.

126 {
127 $this->expectException(\ilException::class);
128 $spp = (new ilStudyProgrammeProgress(123))->setLastChangeBy();
129 }

◆ test_node_id()

ilStudyProgrammeProgressTest::test_node_id ( )

@depends test_init_and_id

Definition at line 24 of file ilStudyProgrammeProgressTest.php.

25 {
26 $spp = (new ilStudyProgrammeProgress(123))->setNodeId(321);
27 $this->assertEquals($spp->getNodeId(), 321);
28 }

◆ test_status()

ilStudyProgrammeProgressTest::test_status (   $status)

@dataProvider status

Definition at line 80 of file ilStudyProgrammeProgressTest.php.

81 {
82 $spp = (new ilStudyProgrammeProgress(123))->setStatus($status);
83 $this->assertEquals($spp->getStatus(), $status);
84 }

◆ test_status_invalid()

ilStudyProgrammeProgressTest::test_status_invalid ( )

@depends test_init_and_id

Definition at line 89 of file ilStudyProgrammeProgressTest.php.

90 {
91 $this->expectException(\ilException::class);
92 $spp = (new ilStudyProgrammeProgress(123))->setStatus(321);
93 }

◆ test_user_id()

ilStudyProgrammeProgressTest::test_user_id ( )

@depends test_init_and_id

Definition at line 33 of file ilStudyProgrammeProgressTest.php.

34 {
35 $spp = (new ilStudyProgrammeProgress(123))->setUserId(321);
36 $this->assertEquals($spp->getUserId(), 321);
37 }

◆ test_vq_date()

ilStudyProgrammeProgressTest::test_vq_date ( )

@depends test_init_and_id

Definition at line 166 of file ilStudyProgrammeProgressTest.php.

167 {
168 $dl = DateTime::createFromFormat('Ymd', '20201011');
169 $spp = (new ilStudyProgrammeProgress(123))->setValidityOfQualification($dl);
170 $this->assertEquals($spp->getValidityOfQualification()->format('Ymd'), '20201011');
171 }

The documentation for this class was generated from the following file: