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;
22 'button' => $this->createMock(
C\
Button\Factory::class),
23 'divider' => $this->createMock(
C\Divider\Factory::class),
28 $this->mocks = $mocks;
30 public function legacy($content)
32 $f =
new I\Component\Legacy\Factory(
new I\
Component\SignalGenerator());
33 return $f->legacy($content);
35 public function button()
37 return $this->mocks[
'button'];
39 public function divider()
41 return $this->mocks[
'divider'];
43 public function symbol() : C\Symbol\Factory
45 return new I\Component\Symbol\Factory(
56 return new \ILIAS\UI\Implementation\Component\Card\Factory();
62 $image =
new I\Component\Image\Image(
"standard",
"src",
"alt");
64 return $cf->repositoryObject(
"Card Title", $image);
69 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Card\\RepositoryObject", $this->
getBaseCard());
74 $icon =
new I\Component\Symbol\Icon\Standard(
"crs",
'Course',
'medium',
false);
76 $card = $card->withObjectIcon($icon);
78 $this->assertEquals($card->getObjectIcon(), $icon);
83 $progressmeter =
new I\Component\Chart\ProgressMeter\Mini(100, 70);
85 $card = $card->withProgress($progressmeter);
87 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Chart\\ProgressMeter\\Mini", $progressmeter);
88 $this->assertEquals($progressmeter, $card->getProgress());
94 $card_with_cert_true = $card->withCertificateIcon(
true);
95 $card_with_cert_false = $card->withCertificateIcon(
false);
97 $this->assertNull($card->getCertificateIcon());
98 $this->assertTrue($card_with_cert_true->getCertificateIcon());
99 $this->assertFalse($card_with_cert_false->getCertificateIcon());
106 $f->button()->shy(
"Go to Course",
"#"),
107 $f->button()->shy(
"Go to Portfolio",
"#"),
108 $f->divider()->horizontal(),
109 $f->button()->shy(
"ilias.de",
"http://www.ilias.de")
112 $dropdown =
new I\Component\Dropdown\Standard($items);
114 $card = $card->withActions($dropdown);
116 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Dropdown\\Standard", $dropdown);
117 $this->assertEquals($card->getActions(), $dropdown);
124 $icon =
new I\Component\Symbol\Icon\Standard(
"crs",
'Course',
'medium',
false);
126 $c =
$c->withObjectIcon($icon);
131 <div
class=
"il-card thumbnail">
132 <div
class=
"il-card-repository-head">
134 <img
class=
"icon crs medium" src=
"./templates/default/images/icon_crs.svg" alt=
"Course" />
139 <div
class=
"il-card-repository-dropdown">
143 <div
class=
"il-card-image-container"><img src=
"src" class=
"img-standard" alt=
"alt" /></div>
144 <div
class=
"card-no-highlight"></div>
158 $c =
$c->withCertificateIcon(
true);
163 <div
class=
"il-card thumbnail">
165 <div
class=
"il-card-repository-head">
170 <img
class=
"icon cert medium outlined" src=
"./templates/default/images/outlined/icon_cert.svg" alt=
"Certificate" />
172 <div
class=
"il-card-repository-dropdown">
176 <div
class=
"il-card-image-container"><img src=
"src" class=
"img-standard" alt=
"alt" /></div>
177 <div
class=
"card-no-highlight"></div>
189 $prg =
new I\Component\Chart\ProgressMeter\Mini(100, 80);
190 $c =
$c->withProgress($prg);
195 <div class="il-card thumbnail"> 196 <div class="il-card-repository-head"> 199 <div class="il-chart-progressmeter-box il-chart-progressmeter-mini"> 200 <div class="il-chart-progressmeter-container"> 201 <svg viewBox="0 0 50 40" class="il-chart-progressmeter-viewbox"> 202 <path class="il-chart-progressmeter-circle-bg" stroke-dasharray="100, 100" 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> 203 <path class="il-chart-progressmeter-circle no-success" stroke-dasharray="69.2, 100" 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> 204 <path class="il-chart-progressmeter-needle no-needle" stroke-dasharray="100, 100" d="M25,10 l0,15" style="transform: rotate(deg)"></path> 209 <div class="il-card-repository-dropdown"></div> 211 <div class="il-card-image-container"><img src="src" class="img-standard" alt="alt"/></div> 212 <div class="card-no-highlight"></div> 213 <div class="caption card-title">Card Title</div> 226 $dropdown =
new I\Component\Dropdown\Standard($items);
227 $c =
$c->withActions($dropdown);
231 <div class="il-card thumbnail"> 232 <div class="il-card-repository-head"> 235 <div class="il-card-repository-dropdown"> 236 <div class="dropdown"> 237 <button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown" aria-label="actions" aria-haspopup="true" aria-expanded="false"><span class="caret"></span></button> 238 <ul class="dropdown-menu"> 239 <li><button class="btn btn-link" data-action="https://www.ilias.de" id="id_2">Visit ILIAS</button></li> 244 <div class="il-card-image-container"><img src="src" class="img-standard" alt="alt" /></div> 245 <div class="card-no-highlight"></div> 246 <div class="caption card-title">Card Title</div>
test_render_with_certificate_icon()
Test on Repository Object card implementation.
test_implements_factory_interface()
test_render_with_object_icon()
test_render_with_progressmeter()
test_render_with_actions()
Provides common functionality for UI tests.
test_with_certificate_icon()
assertHTMLEquals($expected_html_as_string, $html_as_string)
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
__construct(Container $dic, ilPlugin $plugin)
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])