5 require_once(__DIR__ .
"/../../../../libs/composer/vendor/autoload.php");
6 require_once(__DIR__ .
"/../../Base.php");
8 use \ILIAS\UI\Component as
C;
21 return new \ILIAS\UI\Implementation\Component\Image\Factory();
29 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Image\\Factory", $f);
30 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Image\\Image", $f->standard(
"source",
"alt"));
31 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Image\\Image", $f->responsive(
"source",
"alt"));
37 $i = $f->standard(
"source",
"alt");
39 $this->assertEquals($i::STANDARD,
$i->getType());
45 $i = $f->standard(
"source",
"alt");
47 $this->assertEquals(
"source",
$i->getSource());
53 $i = $f->standard(
"source",
"alt");
55 $this->assertEquals(
"alt",
$i->getAlt());
62 $i = $f->standard(
"source",
"alt");
63 $i =
$i->withSource(
"newSource");
64 $this->assertEquals(
"newSource",
$i->getSource());
70 $i = $f->standard(
"source",
"alt");
71 $i =
$i->withAlt(
"newAlt");
72 $this->assertEquals(
"newAlt",
$i->getAlt());
78 $i = $f->standard(
"source",
"alt");
79 $i =
$i->withAction(
"newAction");
80 $this->assertEquals(
"newAction",
$i->getAction());
88 $f->standard(1,
"alt");
89 $this->assertFalse(
"This should not happen");
99 $f->standard(
"source", 1);
100 $this->assertFalse(
"This should not happen");
109 $i = $f->standard(
"source",
"alt");
113 $expected =
"<img src=\"source\" class=\"img-standard\" alt=\"alt\" />";
115 $this->assertEquals($expected,
$html);
122 $i = $f->responsive(
"source",
"alt");
126 $expected =
"<img src=\"source\" class=\"img-responsive\" alt=\"alt\" />";
128 $this->assertEquals($expected,
$html);
135 $i = $f->responsive(
"source",
"\"=test;\")(blah\"");
139 $expected =
"<img src=\"source\" class=\"img-responsive\" alt=\""=test;")(blah"\" />";
141 $this->assertEquals($expected,
$html);
148 $i = $f->standard(
"source",
"alt")->withAction(
"action");
152 $expected =
"<a href=\"action\"><img src=\"source\" class=\"img-standard\" alt=\"alt\" /></a>";
154 $this->assertEquals($expected,
$html);
test_render_with_action()
Test on button implementation.
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Provides common functionality for UI tests.
test_implements_factory_interface()
test_render_alt_escaping()