Test on Repository Object card implementation.
More...
Test on Repository Object card implementation.
Definition at line 14 of file RepositoryObjectTest.php.
◆ getBaseCard()
RepositoryObjectTest::getBaseCard |
( |
| ) |
|
|
private |
Definition at line 59 of file RepositoryObjectTest.php.
References getCardFactory().
Referenced by test_implements_factory_interface(), test_render_with_actions(), test_render_with_certificate_icon(), test_render_with_object_icon(), test_render_with_progressmeter(), test_with_actions(), test_with_certificate_icon(), test_with_object_icon(), and test_with_progress().
62 $image =
new I\Component\Image\Image(
"standard",
"src",
"alt");
64 return $cf->repositoryObject(
"Card Title", $image);
◆ getCardFactory()
RepositoryObjectTest::getCardFactory |
( |
| ) |
|
|
private |
◆ getFactory()
RepositoryObjectTest::getFactory |
( |
| ) |
|
◆ test_implements_factory_interface()
RepositoryObjectTest::test_implements_factory_interface |
( |
| ) |
|
◆ test_render_with_actions()
RepositoryObjectTest::test_render_with_actions |
( |
| ) |
|
Definition at line 246 of file RepositoryObjectTest.php.
References Vendor\Package\$c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), getBaseCard(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
254 $dropdown =
new I\Component\Dropdown\Standard($items);
255 $c =
$c->withActions($dropdown);
256 $html = $r->render(
$c);
258 $expected_html = <<<EOT
259 <div
class=
"il-card thumbnail">
261 <div
class=
"il-card-repository-head">
268 <div
class=
"il-card-repository-dropdown">
269 <div
class=
"dropdown"><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>
270 <ul
class=
"dropdown-menu">
271 <li><button
class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1" >Visit
ILIAS</button>
278 <img src=
"src" class=
"img-standard" alt=
"alt" />
279 <div
class=
"card-no-highlight"></div>
280 <div
class=
"caption">
Class ChatMainBarProvider .
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_render_with_certificate_icon()
RepositoryObjectTest::test_render_with_certificate_icon |
( |
| ) |
|
Definition at line 160 of file RepositoryObjectTest.php.
References Vendor\Package\$c, ILIAS_UI_TestBase\assertHTMLEquals(), getBaseCard(), and ILIAS_UI_TestBase\getDefaultRenderer().
166 $c =
$c->withCertificateIcon(
true);
168 $html = $r->render(
$c);
170 $expected_html = <<<EOT
171 <div
class=
"il-card thumbnail">
173 <div
class=
"il-card-repository-head">
178 <div
class=
"icon cert medium outlined" aria-label=
"Certificate">
184 <div
class=
"il-card-repository-dropdown">
188 <img src=
"src" class=
"img-standard" alt=
"alt" />
189 <div
class=
"card-no-highlight"></div>
190 <div
class=
"caption">
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_render_with_object_icon()
RepositoryObjectTest::test_render_with_object_icon |
( |
| ) |
|
Definition at line 120 of file RepositoryObjectTest.php.
References Vendor\Package\$c, ILIAS_UI_TestBase\assertHTMLEquals(), getBaseCard(), and ILIAS_UI_TestBase\getDefaultRenderer().
124 $icon =
new I\Component\Symbol\Icon\Standard(
"crs",
'Course',
'medium',
false);
126 $c =
$c->withObjectIcon($icon);
128 $html = $r->render(
$c);
130 $expected_html = <<<EOT
131 <div
class=
"il-card thumbnail">
133 <div
class=
"il-card-repository-head">
135 <div
class=
"icon crs medium" aria-label=
"Course">
144 <div
class=
"il-card-repository-dropdown">
148 <img src=
"src" class=
"img-standard" alt=
"alt" />
149 <div
class=
"card-no-highlight"></div>
150 <div
class=
"caption">
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_render_with_progressmeter()
RepositoryObjectTest::test_render_with_progressmeter |
( |
| ) |
|
Definition at line 200 of file RepositoryObjectTest.php.
References Vendor\Package\$c, ILIAS_UI_TestBase\assertHTMLEquals(), getBaseCard(), and ILIAS_UI_TestBase\getDefaultRenderer().
204 $prg =
new I\Component\Chart\ProgressMeter\Mini(100, 80);
205 $c =
$c->withProgress($prg);
207 $html = $r->render(
$c);
209 $expected_html = <<<EOT
210 <div
class=
"il-card thumbnail">
212 <div
class=
"il-card-repository-head">
217 <div
class=
"il-chart-progressmeter-box il-chart-progressmeter-mini">
218 <div
class=
"il-chart-progressmeter-container">
219 <svg viewBox=
"0 0 50 40" class=
"il-chart-progressmeter-viewbox">
220 <path
class=
"il-chart-progressmeter-circle-bg" stroke-dasharray=
"100, 100" 221 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>
222 <path
class=
"il-chart-progressmeter-circle no-success" stroke-dasharray=
"69.2, 100" 223 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>
224 <path
class=
"il-chart-progressmeter-needle no-needle" stroke-dasharray=
"100, 100" d=
"M25,10 l0,15" 225 style=
"transform: rotate(deg)"></path>
230 <div
class=
"il-card-repository-dropdown">
234 <img src=
"src" class=
"img-standard" alt=
"alt" />
235 <div
class=
"card-no-highlight"></div>
236 <div
class=
"caption">
getDefaultRenderer(JavaScriptBinding $js_binding=null)
assertHTMLEquals($expected_html_as_string, $html_as_string)
◆ test_with_actions()
RepositoryObjectTest::test_with_actions |
( |
| ) |
|
Definition at line 102 of file RepositoryObjectTest.php.
References Vendor\Package\$f, getBaseCard(), and getFactory().
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);
◆ test_with_certificate_icon()
RepositoryObjectTest::test_with_certificate_icon |
( |
| ) |
|
Definition at line 91 of file RepositoryObjectTest.php.
References getBaseCard().
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());
◆ test_with_object_icon()
RepositoryObjectTest::test_with_object_icon |
( |
| ) |
|
Definition at line 72 of file RepositoryObjectTest.php.
References getBaseCard().
74 $icon =
new I\Component\Symbol\Icon\Standard(
"crs",
'Course',
'medium',
false);
76 $card = $card->withObjectIcon($icon);
78 $this->assertEquals($card->getObjectIcon(), $icon);
◆ test_with_progress()
RepositoryObjectTest::test_with_progress |
( |
| ) |
|
Definition at line 81 of file RepositoryObjectTest.php.
References getBaseCard().
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());
The documentation for this class was generated from the following file: