Test on Repository Object card implementation.
More...
Test on Repository Object card implementation.
Definition at line 31 of file RepositoryObjectTest.php.
◆ getBaseCard()
| RepositoryObjectTest::getBaseCard |
( |
| ) |
|
|
private |
Definition at line 77 of file RepositoryObjectTest.php.
References getCardFactory().
Referenced by testImplementsFactoryInterface(), testRenderWithActions(), testRenderWithCertificateIcon(), testRenderWithObjectIcon(), testRenderWithProgressmeter(), testWithActions(), testWithCertificateIcon(), testWithObjectIcon(), testWithProgress(), and testWithTitleAsShy().
77 : C\Card\RepositoryObject
80 $image =
new I\Component\Image\Image(
"standard",
"src",
"alt");
82 return $cf->repositoryObject(
"Card Title", $image);
◆ getCardFactory()
| RepositoryObjectTest::getCardFactory |
( |
| ) |
|
|
private |
◆ getFactory()
| RepositoryObjectTest::getFactory |
( |
| ) |
|
◆ testFactoryWithShyButton()
| RepositoryObjectTest::testFactoryWithShyButton |
( |
| ) |
|
Definition at line 90 of file RepositoryObjectTest.php.
References getCardFactory().
92 $button_factory =
new I\Component\Button\Factory();
93 $button = $button_factory->shy(
"Card Title New",
"");
96 $image =
new I\Component\Image\Image(
"standard",
"src",
"alt");
98 $this->assertEquals($button, $cf->repositoryObject($button, $image)->getTitle());
◆ testImplementsFactoryInterface()
| RepositoryObjectTest::testImplementsFactoryInterface |
( |
| ) |
|
◆ testRenderWithActions()
| RepositoryObjectTest::testRenderWithActions |
( |
| ) |
|
Definition at line 258 of file RepositoryObjectTest.php.
References $c, $r, and getBaseCard().
260 $r = $this->getDefaultRenderer();
265 $dropdown =
new I\Component\Dropdown\Standard($items);
266 $c =
$c->withActions($dropdown);
267 $html = $this->brutallyTrimHTML(
$r->render(
$c));
269 $expected_html = $this->brutallyTrimHTML(
' 270 <div class="il-card thumbnail"> 271 <div class="il-card-repository-head"> 274 <div class="il-card-repository-dropdown"> 275 <div class="dropdown" id="id_3"> 276 <button class="btn btn-default dropdown-toggle" type="button" aria-label="actions" aria-haspopup="true" aria-expanded="false" aria-controls="id_3_menu"><span class="caret"></span></button> 277 <ul id="id_3_menu" class="dropdown-menu"> 278 <li><button class="btn btn-link" data-action="https://www.ilias.de" id="id_2">Visit ILIAS</button></li> 283 <div class="il-card-image-container"><img src="src" class="img-standard" alt="open Card Title" /></div> 284 <div class="card-no-highlight"></div> 285 <div class="caption card-title">Card Title</div> 289 $this->assertHTMLEquals($expected_html, $html);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
◆ testRenderWithCertificateIcon()
| RepositoryObjectTest::testRenderWithCertificateIcon |
( |
| ) |
|
Definition at line 191 of file RepositoryObjectTest.php.
References $c, $r, and getBaseCard().
193 $r = $this->getDefaultRenderer();
197 $c =
$c->withCertificateIcon(
true);
199 $html = $this->brutallyTrimHTML(
$r->render(
$c));
201 $expected_html = $this->brutallyTrimHTML(<<<EOT
202 <div
class=
"il-card thumbnail">
204 <div
class=
"il-card-repository-head">
209 <img
class=
"icon cert medium" src=
"./assets/images/standard/icon_cert.svg" alt=
"Certificate" />
211 <div
class=
"il-card-repository-dropdown">
215 <div
class=
"il-card-image-container"><img src=
"src" class=
"img-standard" alt=
"open Card Title" /></div>
216 <div
class=
"card-no-highlight"></div>
221 $this->assertHTMLEquals($expected_html, $html);
◆ testRenderWithObjectIcon()
| RepositoryObjectTest::testRenderWithObjectIcon |
( |
| ) |
|
Definition at line 159 of file RepositoryObjectTest.php.
References $c, $r, and getBaseCard().
161 $r = $this->getDefaultRenderer();
163 $icon =
new I\Component\Symbol\Icon\Standard(
"crs",
'Course',
'medium',
false);
165 $c =
$c->withObjectIcon($icon);
167 $html = $this->brutallyTrimHTML(
$r->render(
$c));
169 $expected_html = $this->brutallyTrimHTML(<<<EOT
170 <div
class=
"il-card thumbnail">
171 <div
class=
"il-card-repository-head">
173 <img
class=
"icon crs medium" src=
"./assets/images/standard/icon_crs.svg" alt=
"Course" />
178 <div
class=
"il-card-repository-dropdown">
182 <div
class=
"il-card-image-container"><img src=
"src" class=
"img-standard" alt=
"open Card Title" /></div>
183 <div
class=
"card-no-highlight"></div>
188 $this->assertHTMLEquals($expected_html, $html);
◆ testRenderWithProgressmeter()
| RepositoryObjectTest::testRenderWithProgressmeter |
( |
| ) |
|
Definition at line 224 of file RepositoryObjectTest.php.
References $c, $r, and getBaseCard().
226 $r = $this->getDefaultRenderer();
228 $prg =
new I\Component\Chart\ProgressMeter\Mini(100, 80);
229 $c =
$c->withProgress($prg);
231 $html = $this->brutallyTrimHTML(
$r->render(
$c));
233 $expected_html = $this->brutallyTrimHTML(
' 234 <div class="il-card thumbnail"> 235 <div class="il-card-repository-head"> 238 <div class="il-chart-progressmeter-box il-chart-progressmeter-mini"> 239 <div class="il-chart-progressmeter-container"> 240 <svg viewBox="0 0 50 40" class="il-chart-progressmeter-viewbox"> 241 <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> 242 <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> 243 <path class="il-chart-progressmeter-needle no-needle" stroke-dasharray="100, 100" d="M25,10 l0,15" style="transform: rotate(deg)"></path> 248 <div class="il-card-repository-dropdown"></div> 250 <div class="il-card-image-container"><img src="src" class="img-standard" alt="open Card Title"/></div> 251 <div class="card-no-highlight"></div> 252 <div class="caption card-title">Card Title</div> 255 $this->assertHTMLEquals($expected_html, $html);
◆ testWithActions()
| RepositoryObjectTest::testWithActions |
( |
| ) |
|
Definition at line 131 of file RepositoryObjectTest.php.
References Vendor\Package\$f, getBaseCard(), and getFactory().
135 $f->button()->shy(
"Go to Course",
"#"),
136 $f->button()->shy(
"Go to Portfolio",
"#"),
137 $f->divider()->horizontal(),
138 $f->button()->shy(
"ilias.de",
"http://www.ilias.de")
141 $dropdown =
new I\Component\Dropdown\Standard($items);
143 $card = $card->withActions($dropdown);
145 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Dropdown\\Standard", $dropdown);
146 $this->assertEquals($card->getActions(), $dropdown);
◆ testWithCertificateIcon()
| RepositoryObjectTest::testWithCertificateIcon |
( |
| ) |
|
Definition at line 120 of file RepositoryObjectTest.php.
References getBaseCard().
123 $card_with_cert_true = $card->withCertificateIcon(
true);
124 $card_with_cert_false = $card->withCertificateIcon(
false);
126 $this->assertNull($card->getCertificateIcon());
127 $this->assertTrue($card_with_cert_true->getCertificateIcon());
128 $this->assertFalse($card_with_cert_false->getCertificateIcon());
◆ testWithObjectIcon()
| RepositoryObjectTest::testWithObjectIcon |
( |
| ) |
|
Definition at line 101 of file RepositoryObjectTest.php.
References getBaseCard().
103 $icon =
new I\Component\Symbol\Icon\Standard(
"crs",
'Course',
'medium',
false);
105 $card = $card->withObjectIcon($icon);
107 $this->assertEquals($card->getObjectIcon(), $icon);
◆ testWithProgress()
| RepositoryObjectTest::testWithProgress |
( |
| ) |
|
Definition at line 110 of file RepositoryObjectTest.php.
References getBaseCard().
112 $progressmeter =
new I\Component\Chart\ProgressMeter\Mini(100, 70);
114 $card = $card->withProgress($progressmeter);
116 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Chart\\ProgressMeter\\Mini", $progressmeter);
117 $this->assertEquals($progressmeter, $card->getProgress());
◆ testWithTitleAsShy()
| RepositoryObjectTest::testWithTitleAsShy |
( |
| ) |
|
Definition at line 149 of file RepositoryObjectTest.php.
References $c, and getBaseCard().
152 $button_factory =
new I\Component\Button\Factory();
153 $button = $button_factory->shy(
"Card Title New",
"");
155 $c =
$c->withTitle($button);
156 $this->assertEquals($button,
$c->getTitle());
The documentation for this class was generated from the following file: