ILIAS
trunk Revision v11.0_alpha-1689-g66c127b4ae8
◀ 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
SelectSpecificDataTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\AdvancedMetaData\Data\FieldDefinition\TypeSpecificData\Select
;
22
23
use
PHPUnit\Framework\TestCase
;
24
25
class
SelectSpecificDataTest
extends
TestCase
26
{
27
public
function
testGetOptionsSortedByPosition
(): void
28
{
29
$option_1 =
new
OptionImplementation
(5, 13);
30
$option_2 =
new
OptionImplementation
(0, 13);
31
$option_3 =
new
OptionImplementation
(32, 13);
32
$data
=
new
SelectSpecificDataImplementation
(1, $option_1, $option_2, $option_3);
33
34
$options =
$data
->getOptions();
35
$this->assertSame(
36
$option_2,
37
$options->current()
38
);
39
$options->next();
40
$this->assertSame(
41
$option_1,
42
$options->current()
43
);
44
$options->next();
45
$this->assertSame(
46
$option_3,
47
$options->current()
48
);
49
}
50
51
public
function
testHasOptionsTrue
(): void
52
{
53
$option =
new
OptionImplementation
(5, 13);
54
$data
=
new
SelectSpecificDataImplementation
(1, $option);
55
$this->assertTrue(
$data
->hasOptions());
56
}
57
58
public
function
testHasOptionsFalse
(): void
59
{
60
$data
=
new
SelectSpecificDataImplementation
(1);
61
$this->assertFalse(
$data
->hasOptions());
62
}
63
64
public
function
testGetOption
(): void
65
{
66
$option =
new
OptionImplementation
(5, 13);
67
$data
=
new
SelectSpecificDataImplementation
(1, $option);
68
$this->assertSame(
69
$option,
70
$data
->getOption(13)
71
);
72
}
73
74
public
function
testAddOption
(): void
75
{
76
$data
=
new
SelectSpecificDataImplementation
(1);
77
$option =
$data
->addOption();
78
$this->assertSame(
79
$option,
80
$data
->getOptions()->current()
81
);
82
}
83
84
public
function
testRemoveOption
(): void
85
{
86
$option =
new
OptionImplementation
(5, 13);
87
$data
=
new
SelectSpecificDataImplementation
(1, $option);
88
$data
->removeOption(13);
89
$this->assertNull(
$data
->getOption(13));
90
}
91
92
public
function
testContainsChangesOptionRemoved
(): void
93
{
94
$option =
new
OptionImplementation
(5, 13);
95
$data
=
new
SelectSpecificDataImplementation
(1, $option);
96
$data
->removeOption(13);
97
$this->assertTrue(
$data
->containsChanges());
98
}
99
}
ILIAS\MetaData\Elements\Data\Data::FieldDefinition::TypeSpecificData::Select\SelectSpecificDataTest\testHasOptionsTrue
testHasOptionsTrue()
Definition:
SelectSpecificDataTest.php:51
$data
$data
Definition:
ltiregistration.php:29
ILIAS\MetaData\Elements\Data\Data::FieldDefinition::TypeSpecificData::Select\SelectSpecificDataTest\testRemoveOption
testRemoveOption()
Definition:
SelectSpecificDataTest.php:84
ILIAS\MetaData\Elements\Data\Data::FieldDefinition::TypeSpecificData::Select\SelectSpecificDataTest
Definition:
SelectSpecificDataTest.php:25
ILIAS\AdvancedMetaData\Data\FieldDefinition\TypeSpecificData\Select
Definition:
NullOption.php:21
ILIAS\MetaData\Elements\Data\Data::FieldDefinition::TypeSpecificData::Select\OptionImplementation
Definition:
OptionImplementation.php:26
ILIAS\MetaData\Elements\Data\Data::FieldDefinition::TypeSpecificData::Select\SelectSpecificDataTest\testHasOptionsFalse
testHasOptionsFalse()
Definition:
SelectSpecificDataTest.php:58
ILIAS\MetaData\Elements\Data\Data::FieldDefinition::TypeSpecificData::Select\SelectSpecificDataTest\testGetOptionsSortedByPosition
testGetOptionsSortedByPosition()
Definition:
SelectSpecificDataTest.php:27
ILIAS\MetaData\Elements\Data\Data::FieldDefinition::TypeSpecificData::Select\SelectSpecificDataTest\testContainsChangesOptionRemoved
testContainsChangesOptionRemoved()
Definition:
SelectSpecificDataTest.php:92
ILIAS\MetaData\Elements\Data\Data::FieldDefinition::TypeSpecificData::Select\SelectSpecificDataImplementation
Definition:
SelectSpecificDataImplementation.php:26
ILIAS\MetaData\Elements\Data\Data::FieldDefinition::TypeSpecificData::Select\SelectSpecificDataTest\testGetOption
testGetOption()
Definition:
SelectSpecificDataTest.php:64
ILIAS\MetaData\Elements\Data\Data::FieldDefinition::TypeSpecificData::Select\SelectSpecificDataTest\testAddOption
testAddOption()
Definition:
SelectSpecificDataTest.php:74
TestCase
components
ILIAS
AdvancedMetaData
tests
Data
FieldDefinition
TypeSpecificData
Select
SelectSpecificDataTest.php
Generated on Wed Apr 2 2025 23:02:05 for ILIAS by
1.8.13 (using
Doxyfile
)