19 declare(strict_types=1);
21 require_once(__DIR__ .
"/../../../../libs/composer/vendor/autoload.php");
22 require_once(__DIR__ .
"/../../Base.php");
36 public function legacy($content): C\Legacy\Legacy
38 $f =
new I\Component\Legacy\Factory(
new I\
Component\SignalGenerator());
39 return $f->legacy($content);
52 $image =
new I\Component\Image\Image(
"standard",
"src",
"alt");
54 return $cf->standard(
"Card Title", $image);
59 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Card\\Standard", $this->
getBaseCard());
64 $button_factory =
new I\Component\Button\Factory();
65 $button = $button_factory->shy(
"Card Title New",
"");
68 $image =
new I\Component\Image\Image(
"standard",
"src",
"alt");
70 $this->assertEquals($button, $cf->standard($button, $image)->getTitle());
77 $this->assertEquals(
"Card Title",
$c->getTitle());
83 $c =
$c->withTitle(
"Card Title New");
85 $this->assertEquals(
"Card Title New",
$c->getTitle());
91 $button_factory =
new I\Component\Button\Factory();
92 $button = $button_factory->shy(
"Card Title New",
"");
94 $c =
$c->withTitle($button);
95 $this->assertEquals($button,
$c->getTitle());
101 $c =
$c->withTitleAction(
"newAction");
102 $this->assertEquals(
"newAction",
$c->getTitleAction());
108 $signal = $this->createMock(
C\Signal::class);
109 $c =
$c->withTitleAction($signal);
110 $this->assertEquals([$signal],
$c->getTitleAction());
116 $c =
$c->withHighlight(
true);
117 $this->assertTrue(
$c->isHighlighted());
123 $image =
new I\Component\Image\Image(
"standard",
"src",
"alt");
125 $this->assertEquals($card->getImage(), $image);
131 $image_new =
new I\Component\Image\Image(
"standard",
"src/new",
"alt");
132 $c = $card->withImage($image_new);
134 $this->assertEquals(
$c->getImage(), $image_new);
141 $content =
$f->legacy(
"Random Content");
142 $c =
$c->withSections(array($content));
144 $this->assertEquals(
$c->getSections(), array($content));
151 $content = $this->
getFactory()->legacy(
"Random Content");
153 $c =
$c->withSections(array($content));
158 "<div class=\"il-card thumbnail\">" .
159 " <div class=\"il-card-image-container\"><img src=\"src\" class=\"img-standard\" alt=\"open Card Title\" /></div>" .
160 " <div class=\"card-no-highlight\"></div>" .
161 " <div class=\"caption card-title\">Card Title</div>" .
162 " <div class=\"caption\">Random Content</div>" .
172 $c =
$c->withHighlight(
true);
177 "<div class=\"il-card thumbnail\">" .
178 " <div class=\"il-card-image-container\"><img src=\"src\" class=\"img-standard\" alt=\"open Card Title\" /></div>" .
179 " <div class=\"card-highlight\"></div>" .
180 " <div class=\"caption card-title\">Card Title</div>" .
190 $title =
new I\Component\Button\Shy(
'Card Title',
'');
191 $c =
$c->withTitle($title);
196 "<div class=\"il-card thumbnail\">" .
197 " <div class=\"il-card-image-container\"><img src=\"src\" class=\"img-standard\" alt=\"open Card Title\" /></div>" .
198 " <div class=\"card-no-highlight\"></div>" .
199 " <div class=\"caption card-title\">" . $r->render($title) .
"</div>" .
test_render_content_full()
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
test_with_string_title_action()
test_factory_with_shy_button()
test_with_signal_title_action()
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
Test on card implementation.
test_render_content_with_highlight()
Provides common functionality for UI tests.
test_implements_factory_interface()
test_with_title_as_shy_button()
test_render_content_with_component_title()