ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 

Detailed Description

Test on Listing implementation.

Definition at line 30 of file ListingTest.php.

Member Function Documentation

◆ getListingFactory()

◆ testDescriptiveGetItems()

ListingTest::testDescriptiveGetItems ( )

Definition at line 91 of file ListingTest.php.

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

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

◆ testDescriptiveInvalidItems2()

ListingTest::testDescriptiveInvalidItems2 ( )

Definition at line 143 of file ListingTest.php.

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

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

◆ testDescriptiveInvalidItems3()

ListingTest::testDescriptiveInvalidItems3 ( )

Definition at line 154 of file ListingTest.php.

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

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

◆ testDescriptiveWithItems()

ListingTest::testDescriptiveWithItems ( )

Definition at line 118 of file ListingTest.php.

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

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

◆ testImplementsFactoryInterface()

ListingTest::testImplementsFactoryInterface ( )

Definition at line 41 of file ListingTest.php.

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

41  : void
42  {
43  $f = $this->getListingFactory();
44 
45  $this->assertInstanceOf("ILIAS\\UI\\Component\\Listing\\Factory", $f);
46  $this->assertInstanceOf(
47  "ILIAS\\UI\\Component\\Listing\\Ordered",
48  $f->ordered(array("1"))
49  );
50  $this->assertInstanceOf(
51  "ILIAS\\UI\\Component\\Listing\\Unordered",
52  $f->unordered(array("1"))
53  );
54  $this->assertInstanceOf(
55  "ILIAS\\UI\\Component\\Listing\\Descriptive",
56  $f->descriptive(array("k1" => "c1"))
57  );
58 
59  $this->assertInstanceOf(
60  "ILIAS\\UI\\Component\\Listing\\CharacteristicValue\\Factory",
61  $f->characteristicValue()
62  );
63  $this->assertInstanceOf(
64  "ILIAS\\UI\\Component\\Listing\\Entity\\Factory",
65  $f->entity()
66  );
67  $this->assertInstanceOf(
68  "ILIAS\\UI\\Component\\Listing\\Property",
69  $f->property()
70  );
71  }
+ Here is the call graph for this function:

◆ testOrderedGetItems()

ListingTest::testOrderedGetItems ( )

Definition at line 73 of file ListingTest.php.

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

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

◆ testOrderedWithItems()

ListingTest::testOrderedWithItems ( )

Definition at line 100 of file ListingTest.php.

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

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

◆ testRenderDescriptiveListing()

ListingTest::testRenderDescriptiveListing ( )

Definition at line 181 of file ListingTest.php.

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

181  : void
182  {
183  $f = $this->getListingFactory();
184  $r = $this->getDefaultRenderer();
185  $l = $f->descriptive(array("k1" => "c1","k2" => "c2"));
186 
187  $html = $this->normalizeHTML($r->render($l));
188 
189  $expected = "<dl>" .
190  "\t\t<dt>k1</dt>" .
191  "\t<dd>c1</dd>" .
192  "\t\t<dt>k2</dt>" .
193  "\t<dd>c2</dd>\t" .
194  "</dl>";
195 
196  $this->assertEquals($expected, $html);
197  }
$r
+ Here is the call graph for this function:

◆ testRenderOrderedListing()

ListingTest::testRenderOrderedListing ( )

Definition at line 127 of file ListingTest.php.

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

127  : void
128  {
129  $f = $this->getListingFactory();
130  $r = $this->getDefaultRenderer();
131  $l = $f->ordered(array("1","2"));
132 
133  $html = $this->normalizeHTML($r->render($l));
134 
135  $expected = "<ol>" .
136  "\t\t<li>1</li>" .
137  "\t\t<li>2</li>\t" .
138  "</ol>";
139 
140  $this->assertEquals($expected, $html);
141  }
$r
+ Here is the call graph for this function:

◆ testRenderUnorderedListing()

ListingTest::testRenderUnorderedListing ( )

Definition at line 165 of file ListingTest.php.

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

165  : void
166  {
167  $f = $this->getListingFactory();
168  $r = $this->getDefaultRenderer();
169  $l = $f->unordered(array("1","2"));
170 
171  $html = $this->normalizeHTML($r->render($l));
172 
173  $expected = "<ul>" .
174  "\t\t<li>1</li>" .
175  "\t\t<li>2</li>\t" .
176  "</ul>";
177 
178  $this->assertEquals($expected, $html);
179  }
$r
+ Here is the call graph for this function:

◆ testUnorderedGetItems()

ListingTest::testUnorderedGetItems ( )

Definition at line 82 of file ListingTest.php.

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

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

◆ testUnorderedWithItems()

ListingTest::testUnorderedWithItems ( )

Definition at line 109 of file ListingTest.php.

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

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

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