ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilStudyProgrammeSubSettingsTest Class Reference

Tests for: ilStudyProgrammeTypeSettings ilStudyProgrammeAssessmentSettings ilStudyProgrammeDeadlineSettings ilStudyProgrammeValidityOfAchievedQualificationSettings ilStudyProgrammeAutoMailSettings. More...

+ Inheritance diagram for ilStudyProgrammeSubSettingsTest:
+ Collaboration diagram for ilStudyProgrammeSubSettingsTest:

Public Member Functions

 setUp ()
 
 testPRGSettingsType ()
 
 testPRGSettingsTypeToForm ()
 
 testPRGSettingsAssessment ()
 
 testPRGSettingsAssessmentToForm ()
 
 testPRGSettingsDeadline ()
 
 testPRGSettingsDeadlineToForm ()
 
 testPRGSettingsValidity ()
 
 testPRGSettingsValidityToForm ()
 
 testPRGSettingsMail ()
 
 testPRGSettingsMailToForm ()
 

Protected Attributes

ilLanguage $lng
 
Refinery $refinery
 
FieldFactory $field_factory
 
DataFactory $data_factory
 

Detailed Description

Member Function Documentation

◆ setUp()

ilStudyProgrammeSubSettingsTest::setUp ( )

Definition at line 43 of file ilStudyProgrammeSubSettingsTest.php.

43 : void
44 {
45 $this->data_factory = new DataFactory();
46 $this->lng = $this->createMock(ilLanguage::class);
47 $this->refinery = new Refinery($this->data_factory, $this->lng);
48 $this->field_factory = new FieldFactory(
49 $this->createMock(\ILIAS\UI\Implementation\Component\Input\Field\Node\Factory::class),
50 $this->createMock(UploadLimitResolver::class),
51 new SignalGenerator(),
52 $this->data_factory,
53 $this->refinery,
54 $this->lng
55 );
56 }
This implements commonalities between inputs.
Definition: Input.php:43
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

References ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ testPRGSettingsAssessment()

ilStudyProgrammeSubSettingsTest::testPRGSettingsAssessment ( )

◆ testPRGSettingsAssessmentToForm()

ilStudyProgrammeSubSettingsTest::testPRGSettingsAssessmentToForm ( )

Definition at line 91 of file ilStudyProgrammeSubSettingsTest.php.

91 : void
92 {
94 $section = $settings->toFormInput(
95 $this->field_factory,
96 $this->lng,
97 $this->refinery
98 );
99 $this->assertInstanceOf(Field\Section::class, $section);
100 $inputs = $section->getInputs();
101 $this->assertInstanceOf(Field\Numeric::class, array_shift($inputs));
102 $this->assertInstanceOf(Field\Select::class, array_shift($inputs));
103 }

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilStudyProgrammeAssessmentSettings\STATUS_DRAFT.

+ Here is the call graph for this function:

◆ testPRGSettingsDeadline()

ilStudyProgrammeSubSettingsTest::testPRGSettingsDeadline ( )

Definition at line 105 of file ilStudyProgrammeSubSettingsTest.php.

105 : void
106 {
107 $settings = new ilStudyProgrammeDeadlineSettings(2, null);
108 $this->assertEquals(2, $settings->getDeadlinePeriod());
109 $this->assertEquals(13, $settings->withDeadlinePeriod(13)->getDeadlinePeriod());
110 $this->assertNull($settings->getDeadlineDate());
111 $dat = new \DateTimeImmutable();
112 $this->assertEquals($dat, $settings->withDeadlineDate($dat)->getDeadlineDate());
113 }

◆ testPRGSettingsDeadlineToForm()

ilStudyProgrammeSubSettingsTest::testPRGSettingsDeadlineToForm ( )

Definition at line 115 of file ilStudyProgrammeSubSettingsTest.php.

115 : void
116 {
117 $settings = new ilStudyProgrammeDeadlineSettings(null, null);
118 $section = $settings->toFormInput(
119 $this->field_factory,
120 $this->lng,
121 $this->refinery,
122 $this->data_factory
123 );
124 $this->assertInstanceOf(Field\Section::class, $section);
125 $group = $section->getInputs();
126 $this->assertInstanceOf(Field\SwitchableGroup::class, current($group));
127 $inputs = current($group)->getInputs();
128 $group1 = array_shift($inputs);
129 $this->assertEquals([], $group1->getInputs());
130 $group2 = array_shift($inputs);
131 $g_inputs = $group2->getInputs();
132 $this->assertInstanceOf(Field\Numeric::class, array_shift($g_inputs));
133 $group3 = array_shift($inputs);
134 $g_inputs = $group3->getInputs();
135 $this->assertInstanceOf(Field\DateTime::class, array_shift($g_inputs));
136 }

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ testPRGSettingsMail()

ilStudyProgrammeSubSettingsTest::testPRGSettingsMail ( )

Definition at line 183 of file ilStudyProgrammeSubSettingsTest.php.

183 : void
184 {
185 $settings = new ilStudyProgrammeAutoMailSettings(false, null, null);
186 $this->assertTrue($settings->withSendReAssignedMail(true)->getSendReAssignedMail());
187 $this->assertEquals(31, $settings->withReminderNotRestartedByUserDays(31)->getReminderNotRestartedByUserDays());
188 $this->assertEquals(60, $settings->withProcessingEndsNotSuccessfulDays(60)->getProcessingEndsNotSuccessfulDays());
189 }

◆ testPRGSettingsMailToForm()

ilStudyProgrammeSubSettingsTest::testPRGSettingsMailToForm ( )

Definition at line 191 of file ilStudyProgrammeSubSettingsTest.php.

191 : void
192 {
193 $settings = new ilStudyProgrammeAutoMailSettings(false, null, null);
194 $section = $settings->toFormInput(
195 $this->field_factory,
196 $this->lng,
197 $this->refinery
198 );
199 $this->assertInstanceOf(Field\Section::class, $section);
200 $inputs = $section->getInputs();
201 $this->assertInstanceOf(Field\Checkbox::class, array_shift($inputs));
202 $opt = array_shift($inputs);
203 $this->assertInstanceOf(Field\OptionalGroup::class, $opt);
204 $g_inputs = $opt->getInputs();
205 $this->assertInstanceOf(Field\Numeric::class, array_shift($g_inputs));
206 $opt = array_shift($inputs);
207 $this->assertInstanceOf(Field\OptionalGroup::class, $opt);
208 $g_inputs = $opt->getInputs();
209 $this->assertInstanceOf(Field\Numeric::class, array_shift($g_inputs));
210 }

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ testPRGSettingsType()

ilStudyProgrammeSubSettingsTest::testPRGSettingsType ( )

Definition at line 58 of file ilStudyProgrammeSubSettingsTest.php.

58 : void
59 {
60 $settings = new ilStudyProgrammeTypeSettings(765);
61 $this->assertEquals(765, $settings->getTypeId());
62 $this->assertEquals(777, $settings->withTypeId(777)->getTypeId());
63 }

◆ testPRGSettingsTypeToForm()

ilStudyProgrammeSubSettingsTest::testPRGSettingsTypeToForm ( )

Definition at line 65 of file ilStudyProgrammeSubSettingsTest.php.

65 : void
66 {
67 $settings = new ilStudyProgrammeTypeSettings(0);
68 $section = $settings->toFormInput(
69 $this->field_factory,
70 $this->lng,
71 $this->refinery,
72 [3 => 'AA', 7 => 'BB']
73 );
74 $this->assertInstanceOf(Field\Section::class, $section);
75 $inputs = $section->getInputs();
76 $this->assertInstanceOf(Field\Select::class, array_shift($inputs));
77 }

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ testPRGSettingsValidity()

ilStudyProgrammeSubSettingsTest::testPRGSettingsValidity ( )

Definition at line 138 of file ilStudyProgrammeSubSettingsTest.php.

138 : void
139 {
140 $settings = new ilStudyProgrammeValidityOfAchievedQualificationSettings(null, null, null, false);
141 $this->assertEquals(365, $settings->withQualificationPeriod(365)->getQualificationPeriod());
142 $dat = new \DateTimeImmutable();
143 $this->assertEquals($dat, $settings->withQualificationDate($dat)->getQualificationDate());
144 $this->assertEquals(31, $settings->withRestartPeriod(31)->getRestartPeriod());
145 }

◆ testPRGSettingsValidityToForm()

ilStudyProgrammeSubSettingsTest::testPRGSettingsValidityToForm ( )

Definition at line 147 of file ilStudyProgrammeSubSettingsTest.php.

147 : void
148 {
149 $settings = new ilStudyProgrammeValidityOfAchievedQualificationSettings(null, null, null, false);
150 $section = $settings->toFormInput(
151 $this->field_factory,
152 $this->lng,
153 $this->refinery,
154 $this->data_factory
155 );
156 $this->assertInstanceOf(Field\Section::class, $section);
157
158 $groups = $section->getInputs();
159 $sg1 = array_shift($groups);
160 $this->assertInstanceOf(Field\SwitchableGroup::class, $sg1);
161 $sg2 = array_shift($groups);
162 $this->assertInstanceOf(Field\SwitchableGroup::class, $sg1);
163
164 $inputs = $sg1->getInputs();
165 $group1 = array_shift($inputs);
166 $this->assertEquals([], $group1->getInputs());
167 $group2 = array_shift($inputs);
168 $g_inputs = $group2->getInputs();
169 $this->assertInstanceOf(Field\Numeric::class, array_shift($g_inputs));
170 $group3 = array_shift($inputs);
171 $g_inputs = $group3->getInputs();
172 $this->assertInstanceOf(Field\DateTime::class, array_shift($g_inputs));
173
174 $inputs = $sg2->getInputs();
175 $group4 = array_shift($inputs);
176 $this->assertEquals([], $group4->getInputs());
177 $group5 = array_shift($inputs);
178 $g5_inputs = $group5->getInputs();
179 $this->assertInstanceOf(Field\Numeric::class, array_shift($g5_inputs));
180 $this->assertInstanceOf(Field\Checkbox::class, array_shift($g5_inputs));
181 }

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Field Documentation

◆ $data_factory

DataFactory ilStudyProgrammeSubSettingsTest::$data_factory
protected

Definition at line 41 of file ilStudyProgrammeSubSettingsTest.php.

◆ $field_factory

FieldFactory ilStudyProgrammeSubSettingsTest::$field_factory
protected

Definition at line 40 of file ilStudyProgrammeSubSettingsTest.php.

◆ $lng

ilLanguage ilStudyProgrammeSubSettingsTest::$lng
protected

Definition at line 38 of file ilStudyProgrammeSubSettingsTest.php.

◆ $refinery

Refinery ilStudyProgrammeSubSettingsTest::$refinery
protected

Definition at line 39 of file ilStudyProgrammeSubSettingsTest.php.


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