144 : void
145 {
146 $lng = $this->createMock(ilLanguage::class);
149
154 $df,
157 );
158
160 self::VALID_QUALIFICATION_PERIOD_1,
161 new DateTimeImmutable(self::VALID_QUALIFICATION_DATE),
162 self::VALID_RESTART_PERIOD_1,
163 true
164 );
165
166 $lng_consecutive_calls = [];
167 $lng->expects($this->atLeastOnce())
168 ->method('txt')
169 ->willReturnCallback(
170 function (
$txt) use (&$lng_consecutive_calls) {
171 $lng_consecutive_calls[] =
$txt;
173 }
174 );
175
176 $expected_consecutive_calls = [
177 'prg_no_validity_qualification',
178 'vq_period_label',
179 'validity_qualification_period_desc',
180 'validity_qualification_period',
181 'vq_date_label',
182 'validity_qualification_date_desc',
183 'validity_qualification_date',
184 'prg_no_restart',
185 'restart_period_label',
186 'restart_period_desc',
187 'restart_recheck_label',
188 'restart_recheck_desc',
189 'restart_period',
190 'optgrp_label_validity',
191 'optgrp_label_restart',
192 'prg_validity_of_qualification'
193 ];
194
195 $field = $obj->toFormInput(
199 $df
200 );
201
202 $this->assertEquals($expected_consecutive_calls, $lng_consecutive_calls);
203
204 $date_value = $field->getInputs()['validity_qualification']->getValue()[1]['vq_date'];
205 $date = (new DateTimeImmutable($date_value))->format('Y-m-d');
206
207 $this->assertEquals(self::VALID_QUALIFICATION_DATE, $date);
208
209 $restart_field = $field->getInputs()['restart']->getValue()[1]['vq_restart_period'];
210
211 $this->assertEquals(self::VALID_RESTART_PERIOD_1, $restart_field);
212 }
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.