TODO change the custom icons to standard icons Test on Repository Object card implementation.
More...
TODO change the custom icons to standard icons Test on Repository Object card implementation.
Definition at line 15 of file RepositoryObjectTest.php.
◆ getBaseCard()
RepositoryObjectTest::getBaseCard |
( |
| ) |
|
|
private |
Definition at line 52 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().
55 $image =
new I\Component\Image\Image(
"standard",
"src",
"alt");
57 return $cf->repositoryObject(
"Card Title", $image);
◆ getCardFactory()
RepositoryObjectTest::getCardFactory |
( |
| ) |
|
|
private |
◆ getFactory()
RepositoryObjectTest::getFactory |
( |
| ) |
|
- Returns
Definition at line 21 of file RepositoryObjectTest.php.
Referenced by test_render_with_actions(), and test_with_actions().
23 return new \ILIAS\UI\Implementation\Factory(
24 $this->createMock(
C\Counter\Factory::class),
25 $this->createMock(
C\Glyph\Factory::class),
26 $this->createMock(
C\
Button\Factory::class),
27 $this->createMock(
C\Listing\Factory::class),
28 $this->createMock(
C\Image\Factory::class),
29 $this->createMock(
C\Panel\Factory::class),
30 $this->createMock(
C\Modal\Factory::class),
31 $this->createMock(
C\Dropzone\Factory::class),
32 $this->createMock(
C\Popover\Factory::class),
33 $this->createMock(
C\Divider\Factory::class),
34 $this->createMock(
C\Link\Factory::class),
35 $this->createMock(
C\Dropdown\Factory::class),
36 $this->createMock(
C\Item\Factory::class),
37 $this->createMock(
C\Icon\Factory::class),
38 $this->createMock(
C\ViewControl\Factory::class),
39 $this->createMock(
C\Chart\Factory::class),
40 $this->createMock(
C\Input\Factory::class),
41 $this->createMock(
C\Table\Factory::class),
42 $this->createMock(
C\MessageBox\Factory::class),
43 $this->createMock(
C\
Card\Factory::class)
◆ test_implements_factory_interface()
RepositoryObjectTest::test_implements_factory_interface |
( |
| ) |
|
◆ test_render_with_actions()
RepositoryObjectTest::test_render_with_actions |
( |
| ) |
|
Definition at line 239 of file RepositoryObjectTest.php.
References $c, $f, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), data, getBaseCard(), ILIAS_UI_TestBase\getDefaultRenderer(), and getFactory().
247 $dropdown =
new I\Component\Dropdown\Standard($items);
248 $c =
$c->withActions($dropdown);
251 $expected_html = <<<EOT
252 <div
class=
"il-card thumbnail">
254 <div
class=
"il-card-repository-head">
261 <div
class=
"il-card-repository-dropdown">
262 <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>
263 <ul
class=
"dropdown-menu">
264 <li><button
class=
"btn btn-link" data-action=
"https://www.ilias.de" id=
"id_1" >Visit
ILIAS</button>
271 <img src=
"src" class=
"img-standard" alt=
"alt" />
272 <div
class=
"card-no-highlight"></div>
273 <div
class=
"caption">
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 153 of file RepositoryObjectTest.php.
References $c, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), getBaseCard(), and ILIAS_UI_TestBase\getDefaultRenderer().
159 $c =
$c->withCertificateIcon(
true);
163 $expected_html = <<<EOT
164 <div
class=
"il-card thumbnail">
166 <div
class=
"il-card-repository-head">
171 <div
class=
"icon cert medium outlined" aria-label=
"Certificate">
177 <div
class=
"il-card-repository-dropdown">
181 <img src=
"src" class=
"img-standard" alt=
"alt" />
182 <div
class=
"card-no-highlight"></div>
183 <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 113 of file RepositoryObjectTest.php.
References $c, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), getBaseCard(), and ILIAS_UI_TestBase\getDefaultRenderer().
117 $icon =
new I\Component\Icon\Standard(
"crs",
'Course',
'medium',
false);
119 $c =
$c->withObjectIcon($icon);
123 $expected_html = <<<EOT
124 <div
class=
"il-card thumbnail">
126 <div
class=
"il-card-repository-head">
128 <div
class=
"icon crs medium" aria-label=
"Course">
137 <div
class=
"il-card-repository-dropdown">
141 <img src=
"src" class=
"img-standard" alt=
"alt" />
142 <div
class=
"card-no-highlight"></div>
143 <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 193 of file RepositoryObjectTest.php.
References $c, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), getBaseCard(), and ILIAS_UI_TestBase\getDefaultRenderer().
197 $prg =
new I\Component\Chart\ProgressMeter\Mini(100, 80);
198 $c =
$c->withProgress($prg);
202 $expected_html = <<<EOT
203 <div
class=
"il-card thumbnail">
205 <div
class=
"il-card-repository-head">
210 <div
class=
"il-chart-progressmeter-box il-chart-progressmeter-mini">
211 <div
class=
"il-chart-progressmeter-container">
212 <svg viewBox=
"0 0 50 40" class=
"il-chart-progressmeter-viewbox">
213 <path
class=
"il-chart-progressmeter-circle-bg" stroke-dasharray=
"100, 100" 214 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>
215 <path
class=
"il-chart-progressmeter-circle no-success" stroke-dasharray=
"69.2, 100" 216 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>
217 <path
class=
"il-chart-progressmeter-needle no-needle" stroke-dasharray=
"100, 100" 218 d=
"M25,10 l0,15" style=
"transform: rotate(deg)"></path>
223 <div
class=
"il-card-repository-dropdown">
227 <img src=
"src" class=
"img-standard" alt=
"alt" />
228 <div
class=
"card-no-highlight"></div>
229 <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 95 of file RepositoryObjectTest.php.
References $f, getBaseCard(), and getFactory().
99 $f->button()->shy(
"Go to Course",
"#"),
100 $f->button()->shy(
"Go to Portfolio",
"#"),
101 $f->divider()->horizontal(),
102 $f->button()->shy(
"ilias.de",
"http://www.ilias.de")
105 $dropdown =
new I\Component\Dropdown\Standard($items);
107 $card = $card->withActions($dropdown);
109 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Dropdown\\Standard", $dropdown);
110 $this->assertEquals($card->getActions(), $dropdown);
◆ test_with_certificate_icon()
RepositoryObjectTest::test_with_certificate_icon |
( |
| ) |
|
Definition at line 84 of file RepositoryObjectTest.php.
References getBaseCard().
87 $card_with_cert_true = $card->withCertificateIcon(
true);
88 $card_with_cert_false = $card->withCertificateIcon(
false);
90 $this->assertNull($card->getCertificateIcon());
91 $this->assertTrue($card_with_cert_true->getCertificateIcon());
92 $this->assertFalse($card_with_cert_false->getCertificateIcon());
◆ test_with_object_icon()
RepositoryObjectTest::test_with_object_icon |
( |
| ) |
|
Definition at line 65 of file RepositoryObjectTest.php.
References getBaseCard().
67 $icon =
new I\Component\Icon\Standard(
"crs",
'Course',
'medium',
false);
69 $card = $card->withObjectIcon($icon);
71 $this->assertEquals($card->getObjectIcon(), $icon);
◆ test_with_progress()
RepositoryObjectTest::test_with_progress |
( |
| ) |
|
Definition at line 74 of file RepositoryObjectTest.php.
References getBaseCard().
76 $progressmeter =
new I\Component\Chart\ProgressMeter\Mini(100, 70);
78 $card = $card->withProgress($progressmeter);
80 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Chart\\ProgressMeter\\Mini", $progressmeter);
81 $this->assertEquals($progressmeter, $card->getProgress());
The documentation for this class was generated from the following file: