ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ListingTest Class Reference

Test on Listing implementation. More...

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

Public Member Functions

 getListingFactory ()
 
 testImplementsFactoryInterface ()
 
 testOrderedGetItems ()
 
 testUnorderedGetItems ()
 
 testDescriptiveGetItems ()
 
 testOrderedWithItems ()
 
 testUnorderedWithItems ()
 
 testDescriptiveWithItems ()
 
 testRenderOrderedListing ()
 
 testDescriptiveInvalidItems2 ()
 
 testDescriptiveInvalidItems3 ()
 
 testRenderUnorderedListing ()
 
 testRenderDescriptiveListing ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDataFactory ()
 
 getHelpTextRetriever ()
 
 getUploadLimitResolver ()
 
 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 Listing implementation.

Definition at line 30 of file ListingTest.php.

Member Function Documentation

◆ getListingFactory()

◆ testDescriptiveGetItems()

ListingTest::testDescriptiveGetItems ( )

Definition at line 87 of file ListingTest.php.

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

87  : void
88  {
89  $f = $this->getListingFactory();
90  $l = $f->descriptive(array("k1" => "c1","k2" => "c2"));
91 
92  $items = array("k1" => "c1","k2" => "c2");
93  $this->assertEquals($l->getItems(), $items);
94  }
+ Here is the call graph for this function:

◆ testDescriptiveInvalidItems2()

ListingTest::testDescriptiveInvalidItems2 ( )

Definition at line 139 of file ListingTest.php.

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

139  : void
140  {
141  $f = $this->getListingFactory();
142 
143  try {
144  $f->descriptive(array("1"));
145  } catch (InvalidArgumentException $e) {
146  $this->assertEquals("InvalidArgumentException", get_class($e));
147  }
148  }
+ Here is the call graph for this function:

◆ testDescriptiveInvalidItems3()

ListingTest::testDescriptiveInvalidItems3 ( )

Definition at line 150 of file ListingTest.php.

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

150  : void
151  {
152  $f = $this->getListingFactory();
153 
154  try {
155  $f->descriptive(array("1","1"));
156  } catch (InvalidArgumentException $e) {
157  $this->assertEquals("InvalidArgumentException", get_class($e));
158  }
159  }
+ Here is the call graph for this function:

◆ testDescriptiveWithItems()

ListingTest::testDescriptiveWithItems ( )

Definition at line 114 of file ListingTest.php.

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

114  : void
115  {
116  $f = $this->getListingFactory();
117  $l = $f->descriptive(array())->withItems(array("k1" => "c1","k2" => "c2"));
118 
119  $items = array("k1" => "c1","k2" => "c2");
120  $this->assertEquals($l->getItems(), $items);
121  }
+ Here is the call graph for this function:

◆ testImplementsFactoryInterface()

ListingTest::testImplementsFactoryInterface ( )

Definition at line 37 of file ListingTest.php.

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

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  $this->assertInstanceOf(
60  "ILIAS\\UI\\Component\\Listing\\Entity\\Factory",
61  $f->entity()
62  );
63  $this->assertInstanceOf(
64  "ILIAS\\UI\\Component\\Listing\\Property",
65  $f->property()
66  );
67  }
+ Here is the call graph for this function:

◆ testOrderedGetItems()

ListingTest::testOrderedGetItems ( )

Definition at line 69 of file ListingTest.php.

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

69  : void
70  {
71  $f = $this->getListingFactory();
72  $l = $f->ordered(array("1","2"));
73 
74  $items = array("1","2");
75  $this->assertEquals($l->getItems(), $items);
76  }
+ Here is the call graph for this function:

◆ testOrderedWithItems()

ListingTest::testOrderedWithItems ( )

Definition at line 96 of file ListingTest.php.

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

96  : void
97  {
98  $f = $this->getListingFactory();
99  $l = $f->ordered(array())->withItems(array("1","2"));
100 
101  $items = array("1","2");
102  $this->assertEquals($l->getItems(), $items);
103  }
+ Here is the call graph for this function:

◆ testRenderDescriptiveListing()

ListingTest::testRenderDescriptiveListing ( )

Definition at line 177 of file ListingTest.php.

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

177  : void
178  {
179  $f = $this->getListingFactory();
180  $r = $this->getDefaultRenderer();
181  $l = $f->descriptive(array("k1" => "c1","k2" => "c2"));
182 
183  $html = $this->normalizeHTML($r->render($l));
184 
185  $expected = "<dl>" .
186  "\t\t<dt>k1</dt>" .
187  "\t<dd>c1</dd>" .
188  "\t\t<dt>k2</dt>" .
189  "\t<dd>c2</dd>\t" .
190  "</dl>";
191 
192  $this->assertEquals($expected, $html);
193  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:377
normalizeHTML(string $html)
Definition: Base.php:453
$r
+ Here is the call graph for this function:

◆ testRenderOrderedListing()

ListingTest::testRenderOrderedListing ( )

Definition at line 123 of file ListingTest.php.

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

123  : void
124  {
125  $f = $this->getListingFactory();
126  $r = $this->getDefaultRenderer();
127  $l = $f->ordered(array("1","2"));
128 
129  $html = $this->normalizeHTML($r->render($l));
130 
131  $expected = "<ol>" .
132  "\t\t<li>1</li>" .
133  "\t\t<li>2</li>\t" .
134  "</ol>";
135 
136  $this->assertEquals($expected, $html);
137  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:377
normalizeHTML(string $html)
Definition: Base.php:453
$r
+ Here is the call graph for this function:

◆ testRenderUnorderedListing()

ListingTest::testRenderUnorderedListing ( )

Definition at line 161 of file ListingTest.php.

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

161  : void
162  {
163  $f = $this->getListingFactory();
164  $r = $this->getDefaultRenderer();
165  $l = $f->unordered(array("1","2"));
166 
167  $html = $this->normalizeHTML($r->render($l));
168 
169  $expected = "<ul>" .
170  "\t\t<li>1</li>" .
171  "\t\t<li>2</li>\t" .
172  "</ul>";
173 
174  $this->assertEquals($expected, $html);
175  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:377
normalizeHTML(string $html)
Definition: Base.php:453
$r
+ Here is the call graph for this function:

◆ testUnorderedGetItems()

ListingTest::testUnorderedGetItems ( )

Definition at line 78 of file ListingTest.php.

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

78  : void
79  {
80  $f = $this->getListingFactory();
81  $l = $f->unordered(array("1","2"));
82 
83  $items = array("1","2");
84  $this->assertEquals($l->getItems(), $items);
85  }
+ Here is the call graph for this function:

◆ testUnorderedWithItems()

ListingTest::testUnorderedWithItems ( )

Definition at line 105 of file ListingTest.php.

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

105  : void
106  {
107  $f = $this->getListingFactory();
108  $l = $f->unordered(array())->withItems(array("1","2"));
109 
110  $items = array("1","2");
111  $this->assertEquals($l->getItems(), $items);
112  }
+ Here is the call graph for this function:

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