19 declare(strict_types=1);
21 require_once(__DIR__ .
"/../../../../../../../vendor/composer/vendor/autoload.php");
22 require_once(__DIR__ .
"/../../../Base.php");
23 require_once(__DIR__ .
"/CommonFieldRendering.php");
43 $this->data_factory =
new Data\Factory();
50 public function symbol(): I\Symbol\Factory
64 public function getLangKey():
string 73 $df =
new Data\Factory();
74 $language = $this->createMock(
ILIAS\Language\Language::class);
76 return new I\Input\Field\Factory(
88 $format = $this->data_factory->dateFormat()->germanShort();
90 ->withFormat($format);
102 ->withMinValue($dat);
114 ->withMaxValue($dat);
125 $this->assertFalse(
$datetime->getUseTime());
126 $this->assertTrue(
$datetime->withUseTime(
true)->getUseTime());
132 $this->assertFalse(
$datetime->getTimeOnly());
133 $this->assertTrue(
$datetime->withTimeOnly(
true)->getTimeOnly());
139 $this->assertNull(
$datetime->getTimeZone());
140 $tz =
'Europe/Moscow';
143 $datetime->withTimeZone($tz)->getTimeZone()
149 $this->expectException(InvalidArgumentException::class);
151 $tz =
'NOT/aValidTZ';
157 $string_value =
"1985-05-04 00:00";
158 $value = new \DateTimeImmutable($string_value);
169 $this->expectException(InvalidArgumentException::class);
171 ->withValue(
"this is no datetime...");
177 $r = $this->getDefaultRenderer();
178 $html = $this->brutallyTrimHTML(
$r->render(
$datetime));
180 $expected = $this->brutallyTrimHTML(
' 181 <fieldset class="c-input" data-il-ui-component="date-time-field-input" data-il-ui-input-name=""> 182 <label for="id_1">label</label> 183 <div class="c-input__field"> 184 <div class="c-input-group"> 185 <input id="id_1" type="date" class="c-field-datetime" /> 188 <div class="c-input__help-byline">byline</div> 191 $this->assertEquals($expected, $html);
197 ->withNameFrom($this->name_source);
203 $this->testWithAdditionalOnloadCodeRendersId(
$datetime);
Interface Observer Contains several chained tasks and infos about them.