5 require_once(__DIR__ .
"/../../../../../libs/composer/vendor/autoload.php");
6 require_once(__DIR__ .
"/../../../Base.php");
8 use \ILIAS\UI\Component as
C;
9 use \ILIAS\UI\Implementation as
I;
18 return new I\Component\Chart\ProgressMeter\Factory();
25 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Chart\\ProgressMeter\\Factory", $progressmeter);
32 $standard = $progressmeter->standard(400, 250);
33 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Chart\\ProgressMeter\\Standard", $standard);
35 $fixedSize = $progressmeter->fixedSize(400, 250);
36 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Chart\\ProgressMeter\\FixedSize", $fixedSize);
38 $mini = $progressmeter->mini(400, 250);
39 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Chart\\ProgressMeter\\Mini", $mini);
45 $standard =
$f->standard(400, 250, 300, 200);
47 $this->assertEquals($standard->getMaximum(), 400);
48 $this->assertEquals($standard->getMainValue(), 250);
49 $this->assertEquals($standard->getMainValueAsPercent(), 63);
50 $this->assertEquals($standard->getRequired(), 300);
51 $this->assertEquals($standard->getRequiredAsPercent(), 75);
52 $this->assertEquals($standard->getComparison(), 200);
53 $this->assertEquals($standard->getComparisonAsPercent(), 50);
59 $fixedSize =
$f->fixedSize(400, 250, 300, 200);
61 $this->assertEquals($fixedSize->getMaximum(), 400);
62 $this->assertEquals($fixedSize->getMainValue(), 250);
63 $this->assertEquals($fixedSize->getMainValueAsPercent(), 63);
64 $this->assertEquals($fixedSize->getRequired(), 300);
65 $this->assertEquals($fixedSize->getRequiredAsPercent(), 75);
66 $this->assertEquals($fixedSize->getComparison(), 200);
67 $this->assertEquals($fixedSize->getComparisonAsPercent(), 50);
73 $mini =
$f->mini(400, 250, 300);
75 $this->assertEquals($mini->getMaximum(), 400);
76 $this->assertEquals($mini->getMainValue(), 250);
77 $this->assertEquals($mini->getMainValueAsPercent(), 63);
78 $this->assertEquals($mini->getRequired(), 300);
79 $this->assertEquals($mini->getRequiredAsPercent(), 75);
86 $standard =
$f->standard(100, 75, 80, 50);
88 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Chart\\ProgressMeter\\Standard", $standard);
93 '<div class="il-chart-progressmeter-box ">' .
94 '<div class="il-chart-progressmeter-container">' .
95 '<svg viewBox="0 0 50 40" class="il-chart-progressmeter-viewbox">' .
96 '<path class="il-chart-progressmeter-circle-bg" stroke-dasharray="100, 100" ' .
97 'd="M10.4646,37.0354 q-5.858,-5.858 -5.858,-14.142 a1,1 0 1,1 40,0 q0,8.284 -5.858,14.142"></path>' .
98 '<g class="il-chart-progressmeter-multicircle">' .
99 '<path class="il-chart-progressmeter-circle no-success" ' .
100 'd="M9.6514,37.8486 q-6.1948,-6.1948 -6.1948,-14.9552 a1,1 0 1,1 42.30,0 q0,8.7604 -6.1948,14.9552" ' .
101 'stroke-dasharray="75, 100"></path>' .
102 '<path class="il-chart-progressmeter-circle active" ' .
103 'd="M11.2778,36.2222 q-5.5212,-5.5212 -5.5212,-13.3288 a1,1 0 1,1 37.70,0 q0,7.8076 -5.5212,13.3288" ' .
104 'stroke-dasharray="44.4, 100"></path>' .
106 '<g class="il-chart-progressmeter-text">' .
107 '<text class="text-score-info" x="25" y="16"></text>' .
108 '<text class="text-score" x="25" y="25">75 %</text>' .
109 '<text class="text-comparision" x="25" y="31">80 %</text>' .
110 '<text class="text-comparision-info" x="25" y="34"></text>' .
112 '<g class="il-chart-progressmeter-needle " style="transform: rotate(82.8deg)">' .
113 '<polygon class="il-chart-progressmeter-needle-border" points="23.5,0.1 25,2.3 26.5,0.1"></polygon>' .
114 '<polygon class="il-chart-progressmeter-needle-fill" points="23.5,0 25,2.2 26.5,0"></polygon>' .
127 $fixedSize =
$f->fixedSize(100, 75, 80, null, 300);
129 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Chart\\ProgressMeter\\FixedSize", $fixedSize);
131 $html =
$r->render($fixedSize);
134 '<div class="il-chart-progressmeter-box fixed-size">' .
135 '<div class="il-chart-progressmeter-container">' .
136 '<svg viewBox="0 0 50 40" class="il-chart-progressmeter-viewbox">' .
137 '<path class="il-chart-progressmeter-circle-bg" stroke-dasharray="100, 100" ' .
138 'd="M10.4646,37.0354 q-5.858,-5.858 -5.858,-14.142 a1,1 0 1,1 40,0 q0,8.284 -5.858,14.142"></path>' .
139 '<g class="il-chart-progressmeter-monocircle">' .
140 '<path class="il-chart-progressmeter-circle no-success" stroke-dasharray="75, 100" ' .
141 'd="M10.4646,37.0354 q-5.858,-5.858 -5.858,-14.142 a1,1 0 1,1 40,0 q0,8.284 -5.858,14.142"></path>' .
143 '<g class="il-chart-progressmeter-text">' .
144 '<text class="text-score-info" x="25" y="16"></text>' .
145 '<text class="text-score" x="25" y="25">75 %</text>' .
146 '<text class="text-comparision" x="25" y="31">80 %</text>' .
147 '<text class="text-comparision-info" x="25" y="34"></text>' .
149 '<g class="il-chart-progressmeter-needle " style="transform: rotate(82.8deg)">' .
150 '<polygon class="il-chart-progressmeter-needle-border" points="23.5,0.1 25,2.3 26.5,0.1"></polygon>' .
151 '<polygon class="il-chart-progressmeter-needle-fill" points="23.5,0 25,2.2 26.5,0"></polygon>' .
164 $mini =
$f->mini(400, 250, 300);
166 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Chart\\ProgressMeter\\Mini", $mini);
171 '<div class="il-chart-progressmeter-box il-chart-progressmeter-mini">' .
172 '<div class="il-chart-progressmeter-container">' .
173 '<svg viewBox="0 0 50 40" class="il-chart-progressmeter-viewbox">' .
174 '<path class="il-chart-progressmeter-circle-bg" stroke-dasharray="100, 100" ' .
175 'd="M9,35 q-4.3934,-4.3934 -4.3934,-10.6066 a1,1 0 1,1 40,0 q0,6.2132 -4.3934,10.6066"></path>' .
176 '<path class="il-chart-progressmeter-circle no-success" stroke-dasharray="54.495, 100" ' .
177 'd="M9,35 q-4.3934,-4.3934 -4.3934,-10.6066 a1,1 0 1,1 40,0 q0,6.2132 -4.3934,10.6066"></path>' .
178 '<path class="il-chart-progressmeter-needle " stroke-dasharray="100, 100" d="M25,10 l0,15" ' .
179 'style="transform: rotate(57.5deg)"></path>' .
test_get_values_of_standard()
test_render_standard_two_bar()
test_get_values_of_fixedSize()
Test on ProgressMeter implementation.
getDefaultRenderer(JavaScriptBinding $js_binding=null)
test_render_fixedSize_one_bar()
Provides common functionality for UI tests.
assertHTMLEquals($expected_html_as_string, $html_as_string)
test_implements_factory_interface()
test_get_values_of_mini()