5 require_once(__DIR__.
"/../../../../libs/composer/vendor/autoload.php");
6 require_once(__DIR__.
"/../../Base.php");
8 use \ILIAS\UI\Component as
C;
19 return new \ILIAS\UI\Implementation\Component\Image\Factory();
26 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Image\\Factory", $f);
27 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Image\\Image", $f->standard(
"source",
"alt"));
28 $this->assertInstanceOf(
"ILIAS\\UI\\Component\\Image\\Image", $f->responsive(
"source",
"alt"));
33 $i = $f->standard(
"source",
"alt");
35 $this->assertEquals($i::STANDARD, $i->getType());
40 $i = $f->standard(
"source",
"alt");
42 $this->assertEquals(
"source", $i->getSource());
47 $i = $f->standard(
"source",
"alt");
49 $this->assertEquals(
"alt", $i->getAlt());
55 $i = $f->standard(
"source",
"alt");
56 $i = $i->withSource(
"newSource");
57 $this->assertEquals(
"newSource", $i->getSource());
62 $i = $f->standard(
"source",
"alt");
63 $i = $i->withAlt(
"newAlt");
64 $this->assertEquals(
"newAlt", $i->getAlt());
71 $f->standard(1,
"alt");
72 $this->assertFalse(
"This should not happen");
80 $f->standard(
"source",1);
81 $this->assertFalse(
"This should not happen");
88 $i = $f->standard(
"source",
"alt");
92 $expected =
"<img src=\"source\" class=\"img-standard\" alt=\"alt\" />";
94 $this->assertEquals($expected,
$html);
100 $i = $f->responsive(
"source",
"alt");
104 $expected =
"<img src=\"source\" class=\"img-responsive\" alt=\"alt\" />";
106 $this->assertEquals($expected,
$html);
112 $i = $f->responsive(
"source",
"\"=test;\")(blah\"");
116 $expected =
"<img src=\"source\" class=\"img-responsive\" alt=\""=test;")(blah"\" />";
118 $this->assertEquals($expected,
$html);
Test on button implementation.
Provides common functionality for UI tests.
test_implements_factory_interface()
test_render_alt_escaping()