19 declare(strict_types=1);
46 $this->
lng = $this->createMock(ilLanguage::class);
49 $this->createMock(UploadLimitResolver::class),
60 $this->assertEquals(765, $settings->getTypeId());
61 $this->assertEquals(777, $settings->withTypeId(777)->getTypeId());
67 $section = $settings->toFormInput(
71 [3 =>
'AA', 7 =>
'BB']
73 $this->assertInstanceOf(Field\Section::class, $section);
74 $inputs = $section->getInputs();
75 $this->assertInstanceOf(Field\Select::class, array_shift(
$inputs));
81 $this->assertEquals(12, $settings->getPoints());
82 $this->assertEquals(13, $settings->withPoints(13)->getPoints());
93 $section = $settings->toFormInput(
98 $this->assertInstanceOf(Field\Section::class, $section);
99 $inputs = $section->getInputs();
100 $this->assertInstanceOf(Field\Numeric::class, array_shift(
$inputs));
101 $this->assertInstanceOf(Field\Select::class, array_shift(
$inputs));
107 $this->assertEquals(2, $settings->getDeadlinePeriod());
108 $this->assertEquals(13, $settings->withDeadlinePeriod(13)->getDeadlinePeriod());
109 $this->assertNull($settings->getDeadlineDate());
110 $dat = new \DateTimeImmutable();
111 $this->assertEquals($dat, $settings->withDeadlineDate($dat)->getDeadlineDate());
117 $section = $settings->toFormInput(
118 $this->field_factory,
123 $this->assertInstanceOf(Field\Section::class, $section);
124 $group = $section->getInputs();
125 $this->assertInstanceOf(Field\SwitchableGroup::class, current($group));
126 $inputs = current($group)->getInputs();
127 $group1 = array_shift(
$inputs);
128 $this->assertEquals([], $group1->getInputs());
129 $group2 = array_shift(
$inputs);
130 $g_inputs = $group2->getInputs();
131 $this->assertInstanceOf(Field\Numeric::class, array_shift($g_inputs));
132 $group3 = array_shift(
$inputs);
133 $g_inputs = $group3->getInputs();
134 $this->assertInstanceOf(Field\DateTime::class, array_shift($g_inputs));
140 $this->assertEquals(365, $settings->withQualificationPeriod(365)->getQualificationPeriod());
141 $dat = new \DateTimeImmutable();
142 $this->assertEquals($dat, $settings->withQualificationDate($dat)->getQualificationDate());
143 $this->assertEquals(31, $settings->withRestartPeriod(31)->getRestartPeriod());
149 $section = $settings->toFormInput(
150 $this->field_factory,
155 $this->assertInstanceOf(Field\Section::class, $section);
157 $groups = $section->getInputs();
158 $sg1 = array_shift($groups);
159 $this->assertInstanceOf(Field\SwitchableGroup::class, $sg1);
160 $sg2 = array_shift($groups);
161 $this->assertInstanceOf(Field\SwitchableGroup::class, $sg1);
164 $group1 = array_shift(
$inputs);
165 $this->assertEquals([], $group1->getInputs());
166 $group2 = array_shift(
$inputs);
167 $g_inputs = $group2->getInputs();
168 $this->assertInstanceOf(Field\Numeric::class, array_shift($g_inputs));
169 $group3 = array_shift(
$inputs);
170 $g_inputs = $group3->getInputs();
171 $this->assertInstanceOf(Field\DateTime::class, array_shift($g_inputs));
174 $group4 = array_shift(
$inputs);
175 $this->assertEquals([], $group4->getInputs());
176 $group5 = array_shift(
$inputs);
177 $g5_inputs = $group5->getInputs();
178 $this->assertInstanceOf(Field\Numeric::class, array_shift($g5_inputs));
179 $this->assertInstanceOf(Field\Checkbox::class, array_shift($g5_inputs));
185 $this->assertTrue($settings->withSendReAssignedMail(
true)->getSendReAssignedMail());
186 $this->assertEquals(31, $settings->withReminderNotRestartedByUserDays(31)->getReminderNotRestartedByUserDays());
187 $this->assertEquals(60, $settings->withProcessingEndsNotSuccessfulDays(60)->getProcessingEndsNotSuccessfulDays());
193 $section = $settings->toFormInput(
194 $this->field_factory,
198 $this->assertInstanceOf(Field\Section::class, $section);
199 $inputs = $section->getInputs();
200 $this->assertInstanceOf(Field\Checkbox::class, array_shift(
$inputs));
202 $this->assertInstanceOf(Field\OptionalGroup::class, $opt);
203 $g_inputs = $opt->getInputs();
204 $this->assertInstanceOf(Field\Numeric::class, array_shift($g_inputs));
206 $this->assertInstanceOf(Field\OptionalGroup::class, $opt);
207 $g_inputs = $opt->getInputs();
208 $this->assertInstanceOf(Field\Numeric::class, array_shift($g_inputs));
testPRGSettingsDeadline()
DataFactory $data_factory
Tests for: ilStudyProgrammeTypeSettings ilStudyProgrammeAssessmentSettings ilStudyProgrammeDeadlineSe...
testPRGSettingsValidity()
testPRGSettingsAssessmentToForm()
testPRGSettingsAssessment()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
testPRGSettingsTypeToForm()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testPRGSettingsValidityToForm()
testPRGSettingsDeadlineToForm()
testPRGSettingsMailToForm()
FieldFactory $field_factory