19 declare(strict_types=1);
35 self::VALID_DEADLINE_PERIOD_1,
39 $this->assertEquals(self::VALID_DEADLINE_PERIOD_1, $obj->getDeadlinePeriod());
40 $this->assertEquals(self::VALID_DEADLINE_DATE, $obj->getDeadlineDate()->format(
'Y-m-d'));
47 self::INVALID_DEADLINE_PERIOD,
52 $this->assertTrue(
true);
59 self::VALID_DEADLINE_PERIOD_1,
63 $new = $obj->withDeadlinePeriod(self::VALID_DEADLINE_PERIOD_2);
65 $this->assertEquals(self::VALID_DEADLINE_PERIOD_1, $obj->getDeadlinePeriod());
66 $this->assertEquals(self::VALID_DEADLINE_PERIOD_2, $new->getDeadlinePeriod());
72 self::VALID_DEADLINE_PERIOD_1,
77 $obj->withDeadlinePeriod(self::INVALID_DEADLINE_PERIOD);
80 $this->assertTrue(
true);
86 $lng = $this->createMock(ilLanguage::class);
99 self::VALID_DEADLINE_PERIOD_1,
103 $lng_consecutive_calls = [];
104 $lng->expects($this->atLeastOnce())
106 ->willReturnCallback(
107 function (
$txt) use (&$lng_consecutive_calls) {
108 $lng_consecutive_calls[] =
$txt;
113 $expected_consecutive_calls = [
115 'prg_deadline_period_label',
116 'prg_deadline_period_desc',
117 'prg_deadline_period',
118 'prg_deadline_date_label',
119 'prg_deadline_date_desc',
121 'prg_deadline_settings' 124 $field = $obj->toFormInput(
131 $this->assertEquals($expected_consecutive_calls, $lng_consecutive_calls);
133 $switchable_group = $field->getInputs()[
'prg_deadline'];
134 $this->assertInstanceOf(
135 SwitchableGroup::class,
139 $date_value = $switchable_group->getValue()[1][
'deadline_date'];
141 $this->assertEquals(self::VALID_DEADLINE_DATE, $date);
143 $inputs = $switchable_group->getInputs();
145 $this->assertInstanceOf(
Interface Observer Contains several chained tasks and infos about them.
testSuccessfulWithDeadlinePeriod()
testFailCreateWithInvalidDeadlinePeriod()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testFailWithDeadlinePeriod()
const VALID_DEADLINE_DATE
const VALID_DEADLINE_PERIOD_1
const VALID_DEADLINE_PERIOD_2
const INVALID_DEADLINE_PERIOD