ILIAS  release_8 Revision v8.24
ChartScaleBarTest 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 ChartScaleBarTest:
+ Collaboration diagram for ChartScaleBarTest:

Public Member Functions

 test_implements_factory_interface ()
 
 test_get_items ()
 
 test_render ()
 
- 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)
 

Protected Member Functions

 getFactory ()
 
- 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 scale bar charts.

Definition at line 30 of file ChartScaleBarTest.php.

Member Function Documentation

◆ getFactory()

ChartScaleBarTest::getFactory ( )
protected

Definition at line 32 of file ChartScaleBarTest.php.

33 {
34 return new I\Component\Chart\Factory(
35 $this->createMock(C\Chart\ProgressMeter\Factory::class),
36 $this->createMock(C\Chart\Bar\Factory::class)
37 );
38 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by test_get_items(), test_implements_factory_interface(), and test_render().

+ Here is the caller graph for this function:

◆ test_get_items()

ChartScaleBarTest::test_get_items ( )

Definition at line 47 of file ChartScaleBarTest.php.

47 : void
48 {
49 $f = $this->getFactory();
50
51 $items = array(
52 "None" => false,
53 "Low" => false,
54 "Medium" => true,
55 "High" => false
56 );
57
58 $c = $f->scaleBar($items);
59
60 $this->assertEquals($c->getItems(), $items);
61 }
$c
Definition: cli.php:38

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

+ Here is the call graph for this function:

◆ test_implements_factory_interface()

ChartScaleBarTest::test_implements_factory_interface ( )

Definition at line 40 of file ChartScaleBarTest.php.

40 : void
41 {
42 $f = $this->getFactory();
43
44 $this->assertInstanceOf("ILIAS\\UI\\Component\\Chart\\ScaleBar", $f->scaleBar(array("1" => false)));
45 }

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

+ Here is the call graph for this function:

◆ test_render()

ChartScaleBarTest::test_render ( )

Definition at line 63 of file ChartScaleBarTest.php.

63 : void
64 {
65 $f = $this->getFactory();
66 $r = $this->getDefaultRenderer();
67
68 $items = array(
69 "None" => false,
70 "Low" => false,
71 "Medium" => true,
72 "High" => false
73 );
74
75 $c = $f->scaleBar($items);
76
77 $html = $r->render($c);
78
79 $expected_html = <<<EOT
80<ul class="il-chart-scale-bar">
81 <li style="width:25%">
82 <div class="il-chart-scale-bar-item ">
83 None
84 </div>
85 </li>
86 <li style="width:25%">
87 <div class="il-chart-scale-bar-item ">
88 Low
89 </div>
90 </li>
91 <li style="width:25%">
92 <div class="il-chart-scale-bar-item il-chart-scale-bar-active">
93 Medium <span class="sr-only">(active)</span>
94 </div>
95 </li>
96 <li style="width:25%">
97 <div class="il-chart-scale-bar-item ">
98 High
99 </div>
100 </li>
101</ul>
102EOT;
103
104 $this->assertHTMLEquals($expected_html, $html);
105 }
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
Definition: Base.php:427
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355

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

+ Here is the call graph for this function:

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