Definition at line 25 of file DateFormatTest.php.
◆ setUp()
DateFormatTest::setUp |
( |
| ) |
|
Definition at line 29 of file DateFormatTest.php.
References Vendor\Package\$f.
32 $this->df =
$f->dateFormat();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ testDateFormatApplyTo()
DateFormatTest::testDateFormatApplyTo |
( |
| ) |
|
Definition at line 79 of file DateFormatTest.php.
82 $format = $this->df->germanShort();
83 $this->assertEquals(
"05.04.1985", $format->applyTo($dt));
84 $this->assertEquals(
"05.04.1985", $dt->format((
string) $format));
◆ testDateFormatApplyToWithTime()
DateFormatTest::testDateFormatApplyToWithTime |
( |
| ) |
|
Definition at line 87 of file DateFormatTest.php.
90 $format = $this->df->custom()
91 ->day()->dot()->month()->dot()->year()
92 ->space()->hours12()->colon()->minutes()->space()->meridiem()
94 $this->assertEquals(
"05.04.1985 09:12 pm", $format->applyTo($dt));
95 $this->assertEquals(
"05.04.1985 09:12 pm", $dt->format((
string) $format));
96 $format = $this->df->custom()
97 ->day()->dot()->month()->dot()->year()
98 ->space()->hours24()->colon()->minutes()->colon()->seconds()
100 $this->assertEquals(
"05.04.1985 21:12:30", $format->applyTo($dt));
◆ testDateFormatBuilderAndGetters()
DateFormatTest::testDateFormatBuilderAndGetters |
( |
| ) |
|
Definition at line 44 of file DateFormatTest.php.
47 '.',
',',
'-',
'/',
' ',
':',
'd',
'jS',
'l',
'D',
'W',
'm',
'F',
'M',
'Y',
'y',
'h',
'H',
'i',
's',
'a' 49 $format = $this->df->custom()
50 ->dot()->comma()->dash()->slash()->space()->colon()
51 ->day()->dayOrdinal()->weekday()->weekdayShort()
52 ->week()->month()->monthSpelled()->monthSpelledShort()
53 ->year()->twoDigitYear()
54 ->hours12()->hours24()->minutes()->seconds()->meridiem()
◆ testDateFormatExpand()
DateFormatTest::testDateFormatExpand |
( |
| ) |
|
Definition at line 103 of file DateFormatTest.php.
105 $format = $this->df->germanShort();
106 $appended = $this->df->amend($format)->dot()->dot()->get();
107 $this->assertInstanceOf(
DateFormat\DateFormat::class, $appended);
109 array_merge($format->toArray(), [
'.',
'.']),
◆ testDateFormatFactory()
DateFormatTest::testDateFormatFactory |
( |
| ) |
|
Definition at line 35 of file DateFormatTest.php.
37 $this->assertInstanceOf(
DateFormat\DateFormat::class, $this->df->standard());
38 $this->assertInstanceOf(
DateFormat\DateFormat::class, $this->df->germanShort());
39 $this->assertInstanceOf(
DateFormat\DateFormat::class, $this->df->germanLong());
40 $this->assertInstanceOf(
DateFormat\DateFormat::class, $this->df->americanShort());
41 $this->assertInstanceOf(
DateFormat\FormatBuilder::class, $this->df->custom());
◆ testDateFormatInvalidTokens()
DateFormatTest::testDateFormatInvalidTokens |
( |
| ) |
|
Definition at line 73 of file DateFormatTest.php.
75 $this->expectException(InvalidArgumentException::class);
76 new DateFormat\DateFormat([
'x',
'2']);
◆ $df
The documentation for this class was generated from the following file: