ILIAS
trunk Revision v11.0_alpha-1749-g1a06bdef097
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
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
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
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
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
StringTransformationTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Tests\Refinery\KindlyTo\Transformation
;
22
23
use
ILIAS\Refinery\KindlyTo\Transformation\StringTransformation
;
24
use
PHPUnit\Framework\TestCase
;
25
use
stdClass
;
26
27
class
StringTransformationTest
extends
TestCase
28
{
29
private
StringTransformation
$transformation
;
30
31
protected
function
setUp
(): void
32
{
33
$this->transformation =
new
StringTransformation
();
34
}
35
41
public
function
testStringTransformation
($originVal,
string
$expectedVal): void
42
{
43
$transformedValue = $this->transformation->transform($originVal);
44
$this->assertIsString($transformedValue);
45
$this->assertEquals($expectedVal, $transformedValue);
46
}
47
48
public
static
function
StringTestDataProvider
(): array
49
{
50
$obj =
new
class
() extends
stdClass
{
51
public
function
__toString()
52
{
53
return
'an object'
;
54
}
55
};
56
return
[
57
'string_val'
=> [
'hello'
,
'hello'
],
58
'int_val'
=> [300,
'300'
],
59
'neg_int_val'
=> [-300,
'-300'
],
60
'zero_int_val'
=> [0,
'0'
],
61
'pos_bool'
=> [
true
,
'true'
],
62
'neg_bool'
=> [
false
,
'false'
],
63
'float_val'
=> [20.5,
'20.5'
],
64
'object_val'
=> [$obj,
'an object'
]
65
];
66
}
67
}
ILIAS\Tests\Refinery\KindlyTo\Transformation\StringTransformationTest\$transformation
StringTransformation $transformation
Definition:
StringTransformationTest.php:29
ILIAS\Refinery\KindlyTo\Transformation\StringTransformation
Definition:
StringTransformation.php:28
ILIAS\Tests\Refinery\KindlyTo\Transformation\StringTransformationTest\StringTestDataProvider
static StringTestDataProvider()
Definition:
StringTransformationTest.php:48
stdClass
StringTransformation
ILIAS\Tests\Refinery\KindlyTo\Transformation
Definition:
BooleanTransformationTest.php:21
ILIAS\Tests\Refinery\KindlyTo\Transformation\StringTransformationTest\setUp
setUp()
Definition:
StringTransformationTest.php:31
ILIAS\Tests\Refinery\KindlyTo\Transformation\StringTransformationTest
Definition:
StringTransformationTest.php:27
ILIAS\Tests\Refinery\KindlyTo\Transformation\StringTransformationTest\testStringTransformation
testStringTransformation($originVal, string $expectedVal)
StringTestDataProvider
Definition:
StringTransformationTest.php:41
TestCase
components
ILIAS
Refinery
tests
KindlyTo
Transformation
StringTransformationTest.php
Generated on Wed Apr 9 2025 23:03:48 for ILIAS by
1.8.13 (using
Doxyfile
)