ILIAS
release_8 Revision v8.19
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
j
l
m
p
s
t
u
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
v
x
+
Variables
$
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
DateTimeTransformationTest.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
21
namespace
ILIAS\Tests\Refinery\To\Transformation
;
22
23
use
DateTimeImmutable
;
24
use
ILIAS\Refinery\To\Transformation\DateTimeTransformation
;
25
use
PHPUnit\Framework\TestCase
;
26
use
UnexpectedValueException
;
27
28
class
DateTimeTransformationTest
extends
TestCase
29
{
30
private
DateTimeTransformation
$trans
;
31
32
protected
function
setUp
(): void
33
{
34
$this->trans =
new
DateTimeTransformation
();
35
}
36
37
public
function
testTransform
(): void
38
{
39
$value =
'26.05.1977'
;
40
$expected =
new
DateTimeImmutable
($value);
41
42
$this->assertEquals(
43
$expected,
44
$this->trans->transform($value)
45
);
46
}
47
48
public
function
testInvalidTransform
(): void
49
{
50
$this->expectException(UnexpectedValueException::class);
51
$this->trans->transform(
'erroneous'
);
52
}
53
54
public
function
testInvoke
(): void
55
{
56
$value =
'2019/05/26'
;
57
$expected =
new
DateTimeImmutable
($value);
58
$t =
$this->trans
;
59
60
$this->assertEquals($expected, $t($value));
61
}
62
}
DateTimeImmutable
ILIAS\Tests\Refinery\To\Transformation\DateTimeTransformationTest
Definition:
DateTimeTransformationTest.php:28
ILIAS\Tests\Refinery\To\Transformation\DateTimeTransformationTest\testTransform
testTransform()
Definition:
DateTimeTransformationTest.php:37
UnexpectedValueException
ILIAS\Tests\Refinery\To\Transformation
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
BooleanTransformationTest.php:21
ILIAS\Tests\Refinery\TestCase
Definition:
TestCase.php:52
ILIAS\Tests\Refinery\To\Transformation\DateTimeTransformationTest\testInvalidTransform
testInvalidTransform()
Definition:
DateTimeTransformationTest.php:48
ILIAS\Tests\Refinery\To\Transformation\DateTimeTransformationTest\$trans
DateTimeTransformation $trans
Definition:
DateTimeTransformationTest.php:30
ILIAS\Tests\Refinery\To\Transformation\DateTimeTransformationTest\testInvoke
testInvoke()
Definition:
DateTimeTransformationTest.php:54
DateTimeTransformation
ILIAS\Tests\Refinery\To\Transformation\DateTimeTransformationTest\setUp
setUp()
Definition:
DateTimeTransformationTest.php:32
ILIAS\Refinery\To\Transformation\DateTimeTransformation
Transform a string representing a datetime-value to php's DateTimeImmutable see https://www.php.net/manual/de/datetime.formats.php.
Definition:
DateTimeTransformation.php:35
TestCase
tests
Refinery
To
Transformation
DateTimeTransformationTest.php
Generated on Wed Apr 9 2025 22:03:00 for ILIAS by
1.8.13 (using
Doxyfile
)