ILIAS  release_8 Revision v8.24
ListingTest Class Reference

Test on button implementation. More...

+ Inheritance diagram for ListingTest:
+ Collaboration diagram for ListingTest:

Public Member Functions

 getListingFactory ()
 
 test_implements_factory_interface ()
 
 test_ordered_get_items ()
 
 test_unordered_get_items ()
 
 test_descriptive_get_items ()
 
 test_ordered_with_items ()
 
 test_unordered_with_items ()
 
 test_descriptive_with_items ()
 
 test_render_ordered_listing ()
 
 test_descriptive_invalid_items2 ()
 
 test_descriptive_invalid_items3 ()
 
 test_render_unordered_listing ()
 
 test_render_descriptive_listing ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDataFactory ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML (string $html)
 
 assertHTMLEquals (string $expected_html_as_string, string $html_as_string)
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML (string $html)
 A more radical version of normalizeHTML. More...
 
 brutallyTrimSignals (string $html)
 A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output. More...
 

Detailed Description

Test on button implementation.

Definition at line 30 of file ListingTest.php.

Member Function Documentation

◆ getListingFactory()

◆ test_descriptive_get_items()

ListingTest::test_descriptive_get_items ( )

Definition at line 79 of file ListingTest.php.

79 : void
80 {
81 $f = $this->getListingFactory();
82 $l = $f->descriptive(array("k1" => "c1","k2" => "c2"));
83
84 $items = array("k1" => "c1","k2" => "c2");
85 $this->assertEquals($l->getItems(), $items);
86 }

References Vendor\Package\$f, and getListingFactory().

+ Here is the call graph for this function:

◆ test_descriptive_invalid_items2()

ListingTest::test_descriptive_invalid_items2 ( )

Definition at line 131 of file ListingTest.php.

131 : void
132 {
133 $f = $this->getListingFactory();
134
135 try {
136 $f->descriptive(array("1"));
137 } catch (InvalidArgumentException $e) {
138 $this->assertEquals("InvalidArgumentException", get_class($e));
139 }
140 }

References Vendor\Package\$e, Vendor\Package\$f, and getListingFactory().

+ Here is the call graph for this function:

◆ test_descriptive_invalid_items3()

ListingTest::test_descriptive_invalid_items3 ( )

Definition at line 142 of file ListingTest.php.

142 : void
143 {
144 $f = $this->getListingFactory();
145
146 try {
147 $f->descriptive(array("1","1"));
148 } catch (InvalidArgumentException $e) {
149 $this->assertEquals("InvalidArgumentException", get_class($e));
150 }
151 }

References Vendor\Package\$e, Vendor\Package\$f, and getListingFactory().

+ Here is the call graph for this function:

◆ test_descriptive_with_items()

ListingTest::test_descriptive_with_items ( )

Definition at line 106 of file ListingTest.php.

106 : void
107 {
108 $f = $this->getListingFactory();
109 $l = $f->descriptive(array())->withItems(array("k1" => "c1","k2" => "c2"));
110
111 $items = array("k1" => "c1","k2" => "c2");
112 $this->assertEquals($l->getItems(), $items);
113 }

References Vendor\Package\$f, and getListingFactory().

+ Here is the call graph for this function:

◆ test_implements_factory_interface()

ListingTest::test_implements_factory_interface ( )

Definition at line 37 of file ListingTest.php.

37 : void
38 {
39 $f = $this->getListingFactory();
40
41 $this->assertInstanceOf("ILIAS\\UI\\Component\\Listing\\Factory", $f);
42 $this->assertInstanceOf(
43 "ILIAS\\UI\\Component\\Listing\\Ordered",
44 $f->ordered(array("1"))
45 );
46 $this->assertInstanceOf(
47 "ILIAS\\UI\\Component\\Listing\\Unordered",
48 $f->unordered(array("1"))
49 );
50 $this->assertInstanceOf(
51 "ILIAS\\UI\\Component\\Listing\\Descriptive",
52 $f->descriptive(array("k1" => "c1"))
53 );
54
55 $this->assertInstanceOf(
56 "ILIAS\\UI\\Component\\Listing\\CharacteristicValue\\Factory",
57 $f->characteristicValue()
58 );
59 }

References Vendor\Package\$f, and getListingFactory().

+ Here is the call graph for this function:

◆ test_ordered_get_items()

ListingTest::test_ordered_get_items ( )

Definition at line 61 of file ListingTest.php.

61 : void
62 {
63 $f = $this->getListingFactory();
64 $l = $f->ordered(array("1","2"));
65
66 $items = array("1","2");
67 $this->assertEquals($l->getItems(), $items);
68 }

References Vendor\Package\$f, and getListingFactory().

+ Here is the call graph for this function:

◆ test_ordered_with_items()

ListingTest::test_ordered_with_items ( )

Definition at line 88 of file ListingTest.php.

88 : void
89 {
90 $f = $this->getListingFactory();
91 $l = $f->ordered(array())->withItems(array("1","2"));
92
93 $items = array("1","2");
94 $this->assertEquals($l->getItems(), $items);
95 }

References Vendor\Package\$f, and getListingFactory().

+ Here is the call graph for this function:

◆ test_render_descriptive_listing()

ListingTest::test_render_descriptive_listing ( )

Definition at line 169 of file ListingTest.php.

169 : void
170 {
171 $f = $this->getListingFactory();
172 $r = $this->getDefaultRenderer();
173 $l = $f->descriptive(array("k1" => "c1","k2" => "c2"));
174
175 $html = $this->normalizeHTML($r->render($l));
176
177 $expected = "<dl>" .
178 "\t\t<dt>k1</dt>" .
179 "\t<dd>c1</dd>" .
180 "\t\t<dt>k2</dt>" .
181 "\t<dd>c2</dd>\t" .
182 "</dl>";
183
184 $this->assertEquals($expected, $html);
185 }
normalizeHTML(string $html)
Definition: Base.php:422
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355

References Vendor\Package\$f, ILIAS_UI_TestBase\getDefaultRenderer(), getListingFactory(), and ILIAS_UI_TestBase\normalizeHTML().

+ Here is the call graph for this function:

◆ test_render_ordered_listing()

ListingTest::test_render_ordered_listing ( )

Definition at line 115 of file ListingTest.php.

115 : void
116 {
117 $f = $this->getListingFactory();
118 $r = $this->getDefaultRenderer();
119 $l = $f->ordered(array("1","2"));
120
121 $html = $this->normalizeHTML($r->render($l));
122
123 $expected = "<ol>" .
124 "\t\t<li>1</li>" .
125 "\t\t<li>2</li>\t" .
126 "</ol>";
127
128 $this->assertEquals($expected, $html);
129 }

References Vendor\Package\$f, ILIAS_UI_TestBase\getDefaultRenderer(), getListingFactory(), and ILIAS_UI_TestBase\normalizeHTML().

+ Here is the call graph for this function:

◆ test_render_unordered_listing()

ListingTest::test_render_unordered_listing ( )

Definition at line 153 of file ListingTest.php.

153 : void
154 {
155 $f = $this->getListingFactory();
156 $r = $this->getDefaultRenderer();
157 $l = $f->unordered(array("1","2"));
158
159 $html = $this->normalizeHTML($r->render($l));
160
161 $expected = "<ul>" .
162 "\t\t<li>1</li>" .
163 "\t\t<li>2</li>\t" .
164 "</ul>";
165
166 $this->assertEquals($expected, $html);
167 }

References Vendor\Package\$f, ILIAS_UI_TestBase\getDefaultRenderer(), getListingFactory(), and ILIAS_UI_TestBase\normalizeHTML().

+ Here is the call graph for this function:

◆ test_unordered_get_items()

ListingTest::test_unordered_get_items ( )

Definition at line 70 of file ListingTest.php.

70 : void
71 {
72 $f = $this->getListingFactory();
73 $l = $f->unordered(array("1","2"));
74
75 $items = array("1","2");
76 $this->assertEquals($l->getItems(), $items);
77 }

References Vendor\Package\$f, and getListingFactory().

+ Here is the call graph for this function:

◆ test_unordered_with_items()

ListingTest::test_unordered_with_items ( )

Definition at line 97 of file ListingTest.php.

97 : void
98 {
99 $f = $this->getListingFactory();
100 $l = $f->unordered(array())->withItems(array("1","2"));
101
102 $items = array("1","2");
103 $this->assertEquals($l->getItems(), $items);
104 }

References Vendor\Package\$f, and getListingFactory().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: