ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
PanelListingTest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for PanelListingTest:
+ Collaboration diagram for PanelListingTest:

Public Member Functions

 getFactory ()
 
 test_implements_factory_interface ()
 
 test_get_title_get_groups ()
 
 test_with_actions ()
 
 test_render_base ()
 
 test_render_with_actions ()
 
- 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Test listing panels

Definition at line 30 of file PanelListingTest.php.

Member Function Documentation

◆ getFactory()

PanelListingTest::getFactory ( )

Definition at line 32 of file PanelListingTest.php.

Referenced by test_get_title_get_groups(), test_implements_factory_interface(), test_render_base(), test_render_with_actions(), and test_with_actions().

32  : C\Panel\Listing\Factory
33  {
34  return new I\Component\Panel\Listing\Factory();
35  }
+ Here is the caller graph for this function:

◆ test_get_title_get_groups()

PanelListingTest::test_get_title_get_groups ( )

Definition at line 54 of file PanelListingTest.php.

References $c, Vendor\Package\$f, getFactory(), and ILIAS\UI\Implementation\Component\Input\Group.

54  : void
55  {
56  $f = $this->getFactory();
57 
58  $groups = array(
59  new I\Component\Item\Group("Subtitle 1", array(
60  new I\Component\Item\Standard("title1"),
61  new I\Component\Item\Standard("title2")
62  )),
63  new I\Component\Item\Group("Subtitle 2", array(
64  new I\Component\Item\Standard("title3")
65  ))
66  );
67 
68  $c = $f->standard("title", $groups);
69 
70  $this->assertEquals("title", $c->getTitle());
71  $this->assertEquals($groups, $c->getItemGroups());
72  }
$c
Definition: cli.php:38
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ test_implements_factory_interface()

PanelListingTest::test_implements_factory_interface ( )

Definition at line 37 of file PanelListingTest.php.

References Vendor\Package\$f, getFactory(), and ILIAS\UI\Implementation\Component\Input\Group.

37  : void
38  {
39  $f = $this->getFactory();
40 
41  $std_list = $f->standard("List Title", array(
42  new I\Component\Item\Group("Subtitle 1", array(
43  new I\Component\Item\Standard("title1"),
44  new I\Component\Item\Standard("title2")
45  )),
46  new I\Component\Item\Group("Subtitle 2", array(
47  new I\Component\Item\Standard("title3")
48  ))
49  ));
50 
51  $this->assertInstanceOf("ILIAS\\UI\\Component\\Panel\\Listing\\Standard", $std_list);
52  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ test_render_base()

PanelListingTest::test_render_base ( )

Definition at line 91 of file PanelListingTest.php.

References $c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\brutallyTrimHTML(), ILIAS_UI_TestBase\getDefaultRenderer(), getFactory(), and ILIAS\UI\Implementation\Component\Input\Group.

91  : void
92  {
93  $f = $this->getFactory();
94  $r = $this->getDefaultRenderer();
95 
96  $groups = array(
97  new I\Component\Item\Group("Subtitle 1", array(
98  new I\Component\Item\Standard("title1"),
99  new I\Component\Item\Standard("title2")
100  )),
101  new I\Component\Item\Group("Subtitle 2", array(
102  new I\Component\Item\Standard("title3")
103  ))
104  );
105 
106  $c = $f->standard("title", $groups);
107 
108  $html = $r->render($c);
109 
110  $expected = <<<EOT
111 <div class="panel il-panel-listing-std-container clearfix">
112  <h2>title</h2>
113  <div class="il-item-group">
114  <h3>Subtitle 1</h3>
115  <div class="il-item-group-items">
116  <ul>
117  <li class="il-std-item-container">
118  <div class="il-item il-std-item ">
119  <div class="il-item-title">title1</div>
120  </div>
121  </li>
122  <li class="il-std-item-container">
123  <div class="il-item il-std-item ">
124  <div class="il-item-title">title2</div>
125  </div>
126  </li>
127  </ul>
128  </div>
129  </div>
130  <div class="il-item-group">
131  <h3>Subtitle 2</h3>
132  <div class="il-item-group-items">
133  <ul>
134  <li class="il-std-item-container">
135  <div class="il-item il-std-item ">
136  <div class="il-item-title">title3</div>
137  </div>
138  </li>
139  </ul>
140  </div>
141  </div>
142 </div>
143 EOT;
144  $this->assertHTMLEquals(
145  $this->brutallyTrimHTML($expected),
146  $this->brutallyTrimHTML($html)
147  );
148  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355
$c
Definition: cli.php:38
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Definition: Base.php:444
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
Definition: Base.php:427
+ Here is the call graph for this function:

◆ test_render_with_actions()

PanelListingTest::test_render_with_actions ( )

Definition at line 150 of file PanelListingTest.php.

References $c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().

150  : void
151  {
152  $f = $this->getFactory();
153  $r = $this->getDefaultRenderer();
154 
155  $groups = array();
156 
157  $actions = new I\Component\Dropdown\Standard(array(
158  new I\Component\Button\Shy("ILIAS", "https://www.ilias.de"),
159  new I\Component\Button\Shy("GitHub", "https://www.github.com")
160  ));
161 
162  $c = $f->standard("title", $groups)
163  ->withActions($actions);
164 
165  $html = $r->render($c);
166 
167  $expected = <<<EOT
168 <div class="panel il-panel-listing-std-container clearfix">
169 <h2>title</h2><div class="dropdown"><button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" id="id_3" aria-label="actions" aria-haspopup="true" aria-expanded="false" aria-controls="id_3_menu"> <span class="caret"></span></button>
170 <ul id="id_3_menu" class="dropdown-menu">
171  <li><button class="btn btn-link" data-action="https://www.ilias.de" id="id_1">ILIAS</button></li>
172  <li><button class="btn btn-link" data-action="https://www.github.com" id="id_2">GitHub</button></li>
173 </ul>
174 </div>
175 </div>
176 EOT;
177  $this->assertHTMLEquals($expected, $html);
178  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355
$c
Definition: cli.php:38
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Bulky.php:21
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
Definition: Base.php:427
+ Here is the call graph for this function:

◆ test_with_actions()

PanelListingTest::test_with_actions ( )

Definition at line 74 of file PanelListingTest.php.

References $c, Vendor\Package\$f, and getFactory().

74  : void
75  {
76  $f = $this->getFactory();
77 
78  $actions = new I\Component\Dropdown\Standard(array(
79  new I\Component\Button\Shy("ILIAS", "https://www.ilias.de"),
80  new I\Component\Button\Shy("GitHub", "https://www.github.com")
81  ));
82 
83  $groups = array();
84 
85  $c = $f->standard("title", $groups)
86  ->withActions($actions);
87 
88  $this->assertEquals($actions, $c->getActions());
89  }
$c
Definition: cli.php:38
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Bulky.php:21
+ Here is the call graph for this function:

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