ILIAS
trunk Revision v11.0_alpha-2662-g519ff7d528f
◀ ilDoc Overview
KeyValueInterruptiveItemTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
require_once(
"vendor/composer/vendor/autoload.php"
);
22
require_once(__DIR__ .
"../../../../Base.php"
);
23
24
use
ILIAS\UI\Component
as
C
;
25
use
ILIAS\UI\Implementation\Component
as
I
;
26
use
ILIAS\UI\Implementation\Component\Modal\InterruptiveItem\KeyValue
;
27
28
class
KeyValueInterruptiveItemTest
extends
ILIAS_UI_TestBase
29
{
30
private
string
$id
;
31
private
string
$key
;
32
private
string
$value
;
33
34
public
function
setUp
(): void
35
{
36
$this->
id
=
'id'
;
37
$this->key =
'key'
;
38
$this->value =
'value'
;
39
}
40
41
protected
function
getItem
():
KeyValue
42
{
43
return
new
KeyValue
(
44
$this->
id
,
45
$this->key,
46
$this->value
47
);
48
}
49
50
public
function
testGetKey
(): void
51
{
52
$item = $this->
getItem
();
53
$this->assertEquals($this->key, $item->getKey());
54
}
55
56
public
function
testGetValue
(): void
57
{
58
$item = $this->
getItem
();
59
$this->assertEquals($this->value, $item->getValue());
60
}
61
62
public
function
testRender
(): void
63
{
64
$r
= $this->getDefaultRenderer();
65
$html =
$r
->render($this->
getItem
());
66
67
$expected = <<<EOT
68
<div
class
=
"c-modal--interruptive__items__key-value"
>
69
<dt
class
=
"c-modal--interruptive__items__key-value__key"
>
70
key <input type=
"hidden"
name=
"interruptive_items[]"
value=
"id"
>
71
</dt>
72
<dd
class
=
"c-modal--interruptive__items__key-value__value"
>
73
value
74
</dd>
75
</div>
76
EOT;
77
78
$this->assertEquals(
79
$this->brutallyTrimHTML($expected),
80
$this->brutallyTrimHTML($html)
81
);
82
}
83
}
ILIAS\UI\Implementation\Component
KeyValueInterruptiveItemTest\testRender
testRender()
Definition:
KeyValueInterruptiveItemTest.php:62
ILIAS\UI\Implementation\Component\Modal\InterruptiveItem\KeyValue
Definition:
KeyValue.php:25
ILIAS\UI\Implementation
KeyValueInterruptiveItemTest\$value
string $value
Definition:
KeyValueInterruptiveItemTest.php:32
KeyValueInterruptiveItemTest
Definition:
KeyValueInterruptiveItemTest.php:28
ILIAS\UI\Component
KeyValueInterruptiveItemTest\$id
string $id
Definition:
KeyValueInterruptiveItemTest.php:30
KeyValueInterruptiveItemTest\setUp
setUp()
Definition:
KeyValueInterruptiveItemTest.php:34
KeyValueInterruptiveItemTest\testGetKey
testGetKey()
Definition:
KeyValueInterruptiveItemTest.php:50
KeyValueInterruptiveItemTest\getItem
getItem()
Definition:
KeyValueInterruptiveItemTest.php:41
KeyValue
ILIAS_UI_TestBase
KeyValueInterruptiveItemTest\$key
string $key
Definition:
KeyValueInterruptiveItemTest.php:31
KeyValueInterruptiveItemTest\testGetValue
testGetValue()
Definition:
KeyValueInterruptiveItemTest.php:56
$r
$r
Definition:
shib_logout.php:142
components
ILIAS
UI
tests
Component
Modal
InterruptiveItem
KeyValueInterruptiveItemTest.php
Generated on Wed Sep 3 2025 23:04:22 for ILIAS by
1.8.13 (using
Doxyfile
)