ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ChartScaleBarTest Class Reference

Test scale bar charts. More...

+ Inheritance diagram for ChartScaleBarTest:
+ Collaboration diagram for ChartScaleBarTest:

Public Member Functions

 getFactory ()
 
 test_implements_factory_interface ()
 
 test_get_items ()
 
 test_render ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null)
 
 normalizeHTML ($html)
 
 assertHTMLEquals ($expected_html_as_string, $html_as_string)
 

Detailed Description

Test scale bar charts.

Definition at line 13 of file ChartScaleBarTest.php.

Member Function Documentation

◆ getFactory()

ChartScaleBarTest::getFactory ( )
Returns

Definition at line 19 of file ChartScaleBarTest.php.

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

20  {
21  return new \ILIAS\UI\Implementation\Factory();
22  }
+ Here is the caller graph for this function:

◆ test_get_items()

ChartScaleBarTest::test_get_items ( )

Definition at line 31 of file ChartScaleBarTest.php.

References array, and getFactory().

32  {
33  $f = $this->getFactory();
34 
35  $items = array(
36  "None" => false,
37  "Low" => false,
38  "Medium" => true,
39  "High" => false
40  );
41 
42  $c = $f->chart()->scaleBar($items);
43 
44  $this->assertEquals($c->getItems(), $items);
45  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ test_implements_factory_interface()

ChartScaleBarTest::test_implements_factory_interface ( )

Definition at line 24 of file ChartScaleBarTest.php.

References array, and getFactory().

25  {
26  $f = $this->getFactory();
27 
28  $this->assertInstanceOf("ILIAS\\UI\\Component\\Chart\\ScaleBar", $f->chart()->scaleBar(array("1" => false)));
29  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ test_render()

ChartScaleBarTest::test_render ( )

Definition at line 47 of file ChartScaleBarTest.php.

References $html, $r, array, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().

48  {
49  $f = $this->getFactory();
50  $r = $this->getDefaultRenderer();
51 
52  $items = array(
53  "None" => false,
54  "Low" => false,
55  "Medium" => true,
56  "High" => false
57  );
58 
59  $c = $f->chart()->scaleBar($items);
60 
61  $html = $r->render($c);
62 
63  $expected_html = <<<EOT
64 <ul class="il-chart-scale-bar">
65  <li style="width:25%">
66  <div class="il-chart-scale-bar-item ">
67  None
68  </div>
69  </li>
70  <li style="width:25%">
71  <div class="il-chart-scale-bar-item ">
72  Low
73  </div>
74  </li>
75  <li style="width:25%">
76  <div class="il-chart-scale-bar-item il-chart-scale-bar-active">
77  Medium <span class="sr-only">(active)</span>
78  </div>
79  </li>
80  <li style="width:25%">
81  <div class="il-chart-scale-bar-item ">
82  High
83  </div>
84  </li>
85 </ul>
86 EOT;
87 
88  $this->assertHTMLEquals($expected_html, $html);
89  }
"color:#CC0000 style
Definition: example_001.php:92
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:216
$r
Definition: example_031.php:79
assertHTMLEquals($expected_html_as_string, $html_as_string)
Definition: Base.php:252
Create styles array
The data for the language used.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

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