ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ()
 
 getDefaultRenderer ()
 
 normalizeHTML ($html)
 
 assertHTMLEquals ($expected_html_as_string, $html_as_string)
 

Detailed Description

Test on button implementation.

Definition at line 13 of file ListingTest.php.

Member Function Documentation

◆ getListingFactory()

ListingTest::getListingFactory ( )
Returns
\ILIAS\UI\Implementation\Component\Listing\Factory

Definition at line 18 of file ListingTest.php.

18 {
19 return new \ILIAS\UI\Implementation\Component\Listing\Factory();
20 }

Referenced by test_descriptive_get_items(), test_descriptive_invalid_items2(), test_descriptive_invalid_items3(), test_descriptive_with_items(), test_implements_factory_interface(), test_ordered_get_items(), test_ordered_with_items(), test_render_descriptive_listing(), test_render_ordered_listing(), test_render_unordered_listing(), test_unordered_get_items(), and test_unordered_with_items().

+ Here is the caller graph for this function:

◆ test_descriptive_get_items()

ListingTest::test_descriptive_get_items ( )

Definition at line 58 of file ListingTest.php.

58 {
59 $f = $this->getListingFactory();
60 $l = $f->descriptive(array("k1"=>"c1","k2"=>"c2"));
61
62 $items = array("k1"=>"c1","k2"=>"c2");
63 $this->assertEquals($l->getItems(), $items);
64 }
global $l
Definition: afr.php:30

References $l, and getListingFactory().

+ Here is the call graph for this function:

◆ test_descriptive_invalid_items2()

ListingTest::test_descriptive_invalid_items2 ( )

Definition at line 106 of file ListingTest.php.

106 {
107 $f = $this->getListingFactory();
108
109 try{
110 $f->descriptive(array("1"));
111 }catch(InvalidArgumentException $e){
112 $this->assertEquals(get_class($e), "InvalidArgumentException");
113 }
114 }

References getListingFactory().

+ Here is the call graph for this function:

◆ test_descriptive_invalid_items3()

ListingTest::test_descriptive_invalid_items3 ( )

Definition at line 116 of file ListingTest.php.

116 {
117 $f = $this->getListingFactory();
118
119 try{
120 $f->descriptive(array("1","1"));
121 }catch(InvalidArgumentException $e){
122 $this->assertEquals(get_class($e), "InvalidArgumentException");
123 }
124 }

References getListingFactory().

+ Here is the call graph for this function:

◆ test_descriptive_with_items()

ListingTest::test_descriptive_with_items ( )

Definition at line 82 of file ListingTest.php.

82 {
83 $f = $this->getListingFactory();
84 $l = $f->descriptive(array())->withItems(array("k1"=>"c1","k2"=>"c2"));
85
86 $items = array("k1"=>"c1","k2"=>"c2");
87 $this->assertEquals($l->getItems(), $items);
88 }

References $l, and getListingFactory().

+ Here is the call graph for this function:

◆ test_implements_factory_interface()

ListingTest::test_implements_factory_interface ( )

Definition at line 23 of file ListingTest.php.

23 {
24 $f = $this->getListingFactory();
25
26 $this->assertInstanceOf("ILIAS\\UI\\Component\\Listing\\Factory", $f);
27 $this->assertInstanceOf
28 ( "ILIAS\\UI\\Component\\Listing\\Ordered"
29 , $f->ordered(array("1"))
30 );
31 $this->assertInstanceOf
32 ( "ILIAS\\UI\\Component\\Listing\\Unordered"
33 , $f->unordered(array("1"))
34 );
35 $this->assertInstanceOf
36 ( "ILIAS\\UI\\Component\\Listing\\Descriptive"
37 , $f->descriptive(array("k1"=>"c1"))
38 );
39 }

References getListingFactory().

+ Here is the call graph for this function:

◆ test_ordered_get_items()

ListingTest::test_ordered_get_items ( )

Definition at line 42 of file ListingTest.php.

42 {
43 $f = $this->getListingFactory();
44 $l = $f->ordered(array("1","2"));
45
46 $items = array("1","2");
47 $this->assertEquals($l->getItems(), $items);
48 }

References $l, and getListingFactory().

+ Here is the call graph for this function:

◆ test_ordered_with_items()

ListingTest::test_ordered_with_items ( )

Definition at line 66 of file ListingTest.php.

66 {
67 $f = $this->getListingFactory();
68 $l = $f->ordered(array())->withItems(array("1","2"));
69
70 $items = array("1","2");
71 $this->assertEquals($l->getItems(), $items);
72 }

References $l, and getListingFactory().

+ Here is the call graph for this function:

◆ test_render_descriptive_listing()

ListingTest::test_render_descriptive_listing ( )

Definition at line 142 of file ListingTest.php.

142 {
143 $f = $this->getListingFactory();
144 $r = $this->getDefaultRenderer();
145 $l = $f->descriptive(array("k1"=>"c1","k2"=>"c2"));
146
147 $html = $this->normalizeHTML($r->render($l));
148
149 $expected = "<dl>".
150 "\t\t<dt>k1</dt>".
151 "\t<dd>c1</dd>".
152 "\t\t<dt>k2</dt>".
153 "\t<dd>c2</dd>\t".
154 "</dl>";
155
156 $this->assertEquals($expected, $html);
157 }
normalizeHTML($html)
Definition: Base.php:110
getDefaultRenderer()
Definition: Base.php:100
$html
Definition: example_001.php:87
$r
Definition: example_031.php:79

References $html, $l, $r, 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 91 of file ListingTest.php.

91 {
92 $f = $this->getListingFactory();
93 $r = $this->getDefaultRenderer();
94 $l = $f->ordered(array("1","2"));
95
96 $html = $this->normalizeHTML($r->render($l));
97
98 $expected = "<ol>".
99 "\t\t<li>1</li>".
100 "\t\t<li>2</li>\t".
101 "</ol>";
102
103 $this->assertEquals($expected, $html);
104 }

References $html, $l, $r, 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 127 of file ListingTest.php.

127 {
128 $f = $this->getListingFactory();
129 $r = $this->getDefaultRenderer();
130 $l = $f->unordered(array("1","2"));
131
132 $html = $this->normalizeHTML($r->render($l));
133
134 $expected = "<ul>".
135 "\t\t<li>1</li>".
136 "\t\t<li>2</li>\t".
137 "</ul>";
138
139 $this->assertEquals($expected, $html);
140 }

References $html, $l, $r, 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 50 of file ListingTest.php.

50 {
51 $f = $this->getListingFactory();
52 $l = $f->unordered(array("1","2"));
53
54 $items = array("1","2");
55 $this->assertEquals($l->getItems(), $items);
56 }

References $l, and getListingFactory().

+ Here is the call graph for this function:

◆ test_unordered_with_items()

ListingTest::test_unordered_with_items ( )

Definition at line 74 of file ListingTest.php.

74 {
75 $f = $this->getListingFactory();
76 $l = $f->unordered(array())->withItems(array("1","2"));
77
78 $items = array("1","2");
79 $this->assertEquals($l->getItems(), $items);
80 }

References $l, and getListingFactory().

+ Here is the call graph for this function:

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