ILIAS
trunk Revision v11.0_alpha-1744-gb0451eebef4
◀ 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
StandardTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\MetaData\XML\Reader\Standard
;
22
23
use
PHPUnit\Framework\TestCase
;
24
use
ILIAS\MetaData\XML\Reader\NullReader
;
25
use
ILIAS\MetaData\XML\Version
;
26
use
ILIAS\MetaData\Elements\SetInterface
;
27
use
ILIAS\MetaData\Elements\NullSet
;
28
use
SimpleXMLElement
;
29
30
class
StandardTest
extends
TestCase
31
{
32
protected
function
getReader
():
Standard
33
{
34
$structurally_coupled =
new
class
() extends
NullReader
{
35
public
function
read(\
SimpleXMLElement
$xml,
Version
$version
):
SetInterface
36
{
37
return
new
class
($xml,
$version
) extends
NullSet
{
38
public
string
$exposed;
39
40
public
function
__construct
(\
SimpleXMLElement
$xml,
Version
$version)
41
{
42
$this->exposed =
'generated by StructurallyCoupled in version '
.
43
$version->value .
' from xml '
. $xml->asXML();
44
}
45
};
46
}
47
};
48
49
$legacy =
new
class
() extends
NullReader
{
50
public
function
read(\
SimpleXMLElement
$xml,
Version
$version
):
SetInterface
51
{
52
return
new
class
($xml,
$version
) extends
NullSet
{
53
public
string
$exposed;
54
55
public
function
__construct
(\
SimpleXMLElement
$xml,
Version
$version)
56
{
57
$this->exposed =
'generated by Legacy in version '
.
58
$version->value .
' from xml '
. $xml->asXML();
59
}
60
};
61
}
62
};
63
64
return
new
Standard
($structurally_coupled, $legacy);
65
}
66
67
public
function
testReadWithVersion10_0
(): void
68
{
69
$xml =
new
SimpleXMLElement
(
'<some>xml</some>'
);
70
$reader = $this->
getReader
();
71
72
$set = $reader->read($xml,
Version::V10_0
);
73
74
$this->assertSame(
75
'generated by StructurallyCoupled in version 10.0 from xml '
. $xml->asXML(),
76
$set->exposed
77
);
78
}
79
80
public
function
testReadWithVersion4_1_0
(): void
81
{
82
$xml =
new
SimpleXMLElement
(
'<some>xml</some>'
);
83
$reader = $this->
getReader
();
84
85
$set = $reader->read($xml, Version::V4_1_0);
86
87
$this->assertSame(
88
'generated by Legacy in version 4.1.0 from xml '
. $xml->asXML(),
89
$set->exposed
90
);
91
}
92
}
SimpleXMLElement
$version
$version
Definition:
plugin.php:24
ILIAS\MetaData\XML\Reader\Standard
Definition:
Legacy.php:21
ILIAS\MetaData\XML\Reader\NullReader
Definition:
NullReader.php:28
ILIAS\MetaData\Elements\NullSet
Definition:
NullSet.php:26
ILIAS\MetaData\XML\Reader\Standard\Standard
Definition:
Standard.php:27
ILIAS\MetaData\XML\V10_0
Definition:
Version.php:26
ILIAS\__construct
__construct()
Constructor setup ILIAS global object public.
Definition:
class.ilias.php:76
SetInterface
ILIAS\MetaData\Elements\SetInterface
Definition:
SetInterface.php:26
ILIAS\MetaData\XML\Version
Version
Definition:
Version.php:23
ILIAS\MetaData\XML\Reader\Standard\StandardTest\testReadWithVersion4_1_0
testReadWithVersion4_1_0()
Definition:
StandardTest.php:80
NullReader
ILIAS\MetaData\XML\Reader\Standard\StandardTest\testReadWithVersion10_0
testReadWithVersion10_0()
Definition:
StandardTest.php:67
NullSet
TestCase
ILIAS\MetaData\XML\Reader\Standard\StandardTest\getReader
getReader()
Definition:
StandardTest.php:32
ILIAS\MetaData\XML\Reader\Standard\StandardTest
Definition:
StandardTest.php:30
components
ILIAS
MetaData
tests
XML
Reader
Standard
StandardTest.php
Generated on Tue Apr 8 2025 23:03:09 for ILIAS by
1.8.13 (using
Doxyfile
)