19 declare(strict_types=1);
21 require_once(__DIR__ .
"/../../../../../../vendor/composer/vendor/autoload.php");
22 require_once(__DIR__ .
"/../../Base.php");
41 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Listing\\Factory",
$f);
42 $this->assertInstanceOf(
43 "ILIAS\\UI\\Component\\Listing\\Ordered",
44 $f->ordered(array(
"1"))
46 $this->assertInstanceOf(
47 "ILIAS\\UI\\Component\\Listing\\Unordered",
48 $f->unordered(array(
"1"))
50 $this->assertInstanceOf(
51 "ILIAS\\UI\\Component\\Listing\\Descriptive",
52 $f->descriptive(array(
"k1" =>
"c1"))
55 $this->assertInstanceOf(
56 "ILIAS\\UI\\Component\\Listing\\CharacteristicValue\\Factory",
57 $f->characteristicValue()
59 $this->assertInstanceOf(
60 "ILIAS\\UI\\Component\\Listing\\Entity\\Factory",
63 $this->assertInstanceOf(
64 "ILIAS\\UI\\Component\\Listing\\Property",
72 $l =
$f->ordered(array(
"1",
"2"));
74 $items = array(
"1",
"2");
75 $this->assertEquals($l->getItems(), $items);
81 $l =
$f->unordered(array(
"1",
"2"));
83 $items = array(
"1",
"2");
84 $this->assertEquals($l->getItems(), $items);
90 $l =
$f->descriptive(array(
"k1" =>
"c1",
"k2" =>
"c2"));
92 $items = array(
"k1" =>
"c1",
"k2" =>
"c2");
93 $this->assertEquals($l->getItems(), $items);
99 $l =
$f->ordered(array())->withItems(array(
"1",
"2"));
101 $items = array(
"1",
"2");
102 $this->assertEquals($l->getItems(), $items);
108 $l =
$f->unordered(array())->withItems(array(
"1",
"2"));
110 $items = array(
"1",
"2");
111 $this->assertEquals($l->getItems(), $items);
117 $l =
$f->descriptive(array())->withItems(array(
"k1" =>
"c1",
"k2" =>
"c2"));
119 $items = array(
"k1" =>
"c1",
"k2" =>
"c2");
120 $this->assertEquals($l->getItems(), $items);
126 $r = $this->getDefaultRenderer();
127 $l =
$f->ordered(array(
"1",
"2"));
129 $html = $this->normalizeHTML(
$r->render($l));
136 $this->assertEquals($expected, $html);
144 $f->descriptive(array(
"1"));
146 $this->assertEquals(
"InvalidArgumentException", get_class($e));
155 $f->descriptive(array(
"1",
"1"));
157 $this->assertEquals(
"InvalidArgumentException", get_class($e));
164 $r = $this->getDefaultRenderer();
165 $l =
$f->unordered(array(
"1",
"2"));
167 $html = $this->normalizeHTML(
$r->render($l));
174 $this->assertEquals($expected, $html);
180 $r = $this->getDefaultRenderer();
181 $l =
$f->descriptive(array(
"k1" =>
"c1",
"k2" =>
"c2"));
183 $html = $this->normalizeHTML(
$r->render($l));
192 $this->assertEquals($expected, $html);
testDescriptiveInvalidItems3()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testImplementsFactoryInterface()
testRenderUnorderedListing()
Test on Listing implementation.
testRenderOrderedListing()
testDescriptiveInvalidItems2()
testDescriptiveWithItems()
testDescriptiveGetItems()
testRenderDescriptiveListing()