19 declare(strict_types=1);
36 self::VALID_QUALIFICATION_PERIOD_1,
38 self::VALID_RESTART_PERIOD_1,
42 $this->assertEquals(self::VALID_QUALIFICATION_PERIOD_1, $obj->getQualificationPeriod());
44 self::VALID_QUALIFICATION_DATE,
45 $obj->getQualificationDate()->format(
'Y-m-d')
47 $this->assertEquals(self::VALID_RESTART_PERIOD_1, $obj->getRestartPeriod());
54 self::INVALID_QUALIFICATION_PERIOD,
56 self::VALID_RESTART_PERIOD_1,
61 $this->assertTrue(
true);
69 self::VALID_QUALIFICATION_PERIOD_1,
71 self::INVALID_RESTART_PERIOD,
76 $this->assertTrue(
true);
83 self::VALID_QUALIFICATION_PERIOD_1,
85 self::VALID_RESTART_PERIOD_1,
89 $new = $obj->withQualificationPeriod(self::VALID_QUALIFICATION_PERIOD_2);
91 $this->assertEquals(self::VALID_QUALIFICATION_PERIOD_1, $obj->getQualificationPeriod());
92 $this->assertEquals(self::VALID_QUALIFICATION_PERIOD_2, $new->getQualificationPeriod());
98 self::VALID_QUALIFICATION_PERIOD_1,
100 self::VALID_RESTART_PERIOD_1,
105 $obj->withQualificationPeriod(self::INVALID_QUALIFICATION_PERIOD);
108 $this->assertTrue(
true);
115 self::VALID_QUALIFICATION_PERIOD_1,
117 self::VALID_RESTART_PERIOD_1,
121 $new = $obj->withRestartPeriod(self::VALID_RESTART_PERIOD_2);
123 $this->assertEquals(self::VALID_RESTART_PERIOD_1, $obj->getRestartPeriod());
124 $this->assertEquals(self::VALID_RESTART_PERIOD_2, $new->getRestartPeriod());
130 self::VALID_QUALIFICATION_PERIOD_1,
132 self::VALID_RESTART_PERIOD_1,
137 $obj->withRestartPeriod(self::INVALID_RESTART_PERIOD);
140 $this->assertTrue(
true);
146 $lng = $this->createMock(ilLanguage::class);
159 self::VALID_QUALIFICATION_PERIOD_1,
161 self::VALID_RESTART_PERIOD_1,
165 $lng_consecutive_calls = [];
166 $lng->expects($this->atLeastOnce())
168 ->willReturnCallback(
169 function (
$txt) use (&$lng_consecutive_calls) {
170 $lng_consecutive_calls[] =
$txt;
175 $expected_consecutive_calls = [
176 'prg_no_validity_qualification',
178 'validity_qualification_period_desc',
179 'validity_qualification_period',
181 'validity_qualification_date_desc',
182 'validity_qualification_date',
184 'restart_period_label',
185 'restart_period_desc',
186 'restart_recheck_label',
187 'restart_recheck_desc',
189 'optgrp_label_validity',
190 'optgrp_label_restart',
191 'prg_validity_of_qualification' 194 $field = $obj->toFormInput(
201 $this->assertEquals($expected_consecutive_calls, $lng_consecutive_calls);
203 $date_value = $field->getInputs()[
'validity_qualification']->getValue()[1][
'vq_date'];
206 $this->assertEquals(self::VALID_QUALIFICATION_DATE, $date);
208 $restart_field = $field->getInputs()[
'restart']->getValue()[1][
'vq_restart_period'];
210 $this->assertEquals(self::VALID_RESTART_PERIOD_1, $restart_field);
216 self::VALID_QUALIFICATION_PERIOD_1,
218 self::VALID_RESTART_PERIOD_1,
222 $this->assertTrue($obj->getRestartRecheck());
223 $this->assertFalse($obj->withRestartRecheck(
false)->getRestartRecheck());
testFailWithQualificationPeriod()
const VALID_RESTART_PERIOD_2
const VALID_QUALIFICATION_DATE
Interface Observer Contains several chained tasks and infos about them.
const INVALID_QUALIFICATION_PERIOD
testFailCreateWithInvalidRestartPeriod()
testFailWithRestartPeriod()
testSuccessfulWithRestartPeriod()
const VALID_QUALIFICATION_PERIOD_2
testSuccessfulWithQualificationPeriod()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const VALID_QUALIFICATION_PERIOD_1
const INVALID_RESTART_PERIOD
testFailCreateWithInvalidQualificationPeriod()
const VALID_RESTART_PERIOD_1