ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ 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
p
s
t
w
+
Functions
_
a
b
c
f
g
h
i
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
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
q
r
s
t
u
v
w
x
z
+
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
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
DateTimeTransformationTest.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 2019 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
5
namespace
ILIAS\Tests\Refinery\To\Transformation
;
6
7
require_once(
'./libs/composer/vendor/autoload.php'
);
8
9
use
ILIAS\Refinery\To\Transformation\DateTimeTransformation
;
10
use
PHPUnit\Framework\TestCase
as
TestCase
;
11
use
ILIAS\Data\Factory
;
12
use
ILIAS\Data\Result
;
13
17
class
DateTimeTransformationTest
extends
TestCase
18
{
22
private
$trans
;
23
24
protected
function
setUp
() : void
25
{
26
$df =
new
Factory
();
27
$this->trans =
new
DateTimeTransformation
($df);
28
}
29
30
public
function
testTransform
()
31
{
32
$value =
'26.05.1977'
;
33
$expected = new \DateTimeImmutable($value);
34
35
$this->assertEquals(
36
$expected,
37
$this->trans->transform($value)
38
);
39
}
40
41
public
function
testInvalidTransform
()
42
{
43
$this->expectException(\InvalidArgumentException::class);
44
$this->trans->transform(
'erroneous'
);
45
}
46
47
public
function
testInvoke
()
48
{
49
$value =
'2019/05/26'
;
50
$expected = new \DateTimeImmutable($value);
51
$t =
$this->trans
;
52
53
$this->assertEquals($expected, $t($value));
54
}
55
}
ILIAS\Data\Result
Definition:
Error.php:4
ILIAS\Tests\Refinery\To\Transformation\DateTimeTransformationTest
TestCase for DateTime transformations.
Definition:
DateTimeTransformationTest.php:17
ILIAS\Tests\Refinery\To\Transformation\DateTimeTransformationTest\testTransform
testTransform()
Definition:
DateTimeTransformationTest.php:30
ILIAS\Tests\Refinery\To\Transformation
Definition:
BooleanTransformationTest.php:8
ILIAS\Tests\Refinery\To\Transformation\DateTimeTransformationTest\testInvalidTransform
testInvalidTransform()
Definition:
DateTimeTransformationTest.php:41
ILIAS\Tests\Refinery\To\Transformation\DateTimeTransformationTest\$trans
$trans
Definition:
DateTimeTransformationTest.php:22
Factory
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:19
ILIAS\Tests\Refinery\To\Transformation\DateTimeTransformationTest\testInvoke
testInvoke()
Definition:
DateTimeTransformationTest.php:47
DateTimeTransformation
ILIAS\Tests\Refinery\To\Transformation\DateTimeTransformationTest\setUp
setUp()
Definition:
DateTimeTransformationTest.php:24
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:15
TestCase
tests
Refinery
To
Transformation
DateTimeTransformationTest.php
Generated on Fri Apr 4 2025 20:01:42 for ILIAS by
1.8.13 (using
Doxyfile
)