19 declare(strict_types=1);
21 require_once(__DIR__ .
"/../../../../../../vendor/composer/vendor/autoload.php");
22 require_once(__DIR__ .
"/../../Base.php");
34 return new Listing\Factory(
45 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Listing\\Factory",
$f);
46 $this->assertInstanceOf(
47 "ILIAS\\UI\\Component\\Listing\\Ordered",
48 $f->ordered(array(
"1"))
50 $this->assertInstanceOf(
51 "ILIAS\\UI\\Component\\Listing\\Unordered",
52 $f->unordered(array(
"1"))
54 $this->assertInstanceOf(
55 "ILIAS\\UI\\Component\\Listing\\Descriptive",
56 $f->descriptive(array(
"k1" =>
"c1"))
59 $this->assertInstanceOf(
60 "ILIAS\\UI\\Component\\Listing\\CharacteristicValue\\Factory",
61 $f->characteristicValue()
63 $this->assertInstanceOf(
64 "ILIAS\\UI\\Component\\Listing\\Entity\\Factory",
67 $this->assertInstanceOf(
68 "ILIAS\\UI\\Component\\Listing\\Property",
76 $l =
$f->ordered(array(
"1",
"2"));
78 $items = array(
"1",
"2");
79 $this->assertEquals($l->getItems(), $items);
85 $l =
$f->unordered(array(
"1",
"2"));
87 $items = array(
"1",
"2");
88 $this->assertEquals($l->getItems(), $items);
94 $l =
$f->descriptive(array(
"k1" =>
"c1",
"k2" =>
"c2"));
96 $items = array(
"k1" =>
"c1",
"k2" =>
"c2");
97 $this->assertEquals($l->getItems(), $items);
103 $l =
$f->ordered(array())->withItems(array(
"1",
"2"));
105 $items = array(
"1",
"2");
106 $this->assertEquals($l->getItems(), $items);
112 $l =
$f->unordered(array())->withItems(array(
"1",
"2"));
114 $items = array(
"1",
"2");
115 $this->assertEquals($l->getItems(), $items);
121 $l =
$f->descriptive(array())->withItems(array(
"k1" =>
"c1",
"k2" =>
"c2"));
123 $items = array(
"k1" =>
"c1",
"k2" =>
"c2");
124 $this->assertEquals($l->getItems(), $items);
130 $r = $this->getDefaultRenderer();
131 $l =
$f->ordered(array(
"1",
"2"));
133 $html = $this->normalizeHTML(
$r->render($l));
140 $this->assertEquals($expected, $html);
148 $f->descriptive(array(
"1"));
150 $this->assertEquals(
"InvalidArgumentException", get_class($e));
159 $f->descriptive(array(
"1",
"1"));
161 $this->assertEquals(
"InvalidArgumentException", get_class($e));
168 $r = $this->getDefaultRenderer();
169 $l =
$f->unordered(array(
"1",
"2"));
171 $html = $this->normalizeHTML(
$r->render($l));
178 $this->assertEquals($expected, $html);
184 $r = $this->getDefaultRenderer();
185 $l =
$f->descriptive(array(
"k1" =>
"c1",
"k2" =>
"c2"));
187 $html = $this->normalizeHTML(
$r->render($l));
196 $this->assertEquals($expected, $html);
testDescriptiveInvalidItems3()
testImplementsFactoryInterface()
testRenderUnorderedListing()
Test on Listing implementation.
testRenderOrderedListing()
testDescriptiveInvalidItems2()
testDescriptiveWithItems()
testDescriptiveGetItems()
testRenderDescriptiveListing()