19 declare(strict_types=1);
45 return new class ($icon, $link, $legacy, $src_from_irss) extends
Renderer {
46 protected ?
string $icon_src =
null;
47 protected ?
string $icon_alt =
null;
48 protected ?
string $link_label =
null;
49 protected ?
string $link_action =
null;
50 protected ?
string $legacy_text =
null;
56 protected string $src_from_irss
60 protected function getFallBackSrc():
string 62 return 'fallback src';
65 protected function customIcon(
string $src,
string $alt):
Icon 67 $this->icon_src = $src;
68 $this->icon_alt = $alt;
72 protected function standardLink(
string $label,
string $action):
Link 74 $this->link_label = $label;
75 $this->link_action = $action;
79 protected function textInLegacy(
string $text):
Content 81 $this->legacy_text = $text;
85 protected function getSourceFromIRSS(
string $string_id):
string 87 return $this->src_from_irss;
90 public function exposeData(): array
93 'icon_src' => $this->icon_src,
94 'icon_alt' => $this->icon_alt,
95 'link_label' => $this->link_label,
96 'link_action' => $this->link_action,
97 'legacy_text' => $this->legacy_text
105 return $this->getMockBuilder(IIcon::class)
106 ->disableOriginalConstructor()
112 return $this->getMockBuilder(ILink::class)
113 ->disableOriginalConstructor()
114 ->onlyMethods([
'withAdditionalRelationshipToReferencedResource'])
120 return $this->getMockBuilder(ILegacy::class)
121 ->disableOriginalConstructor()
127 $uri = $this->getMockBuilder(URI::class)
128 ->disableOriginalConstructor()
130 $uri->method(
'__toString')->willReturn($link);
137 $link->expects($this->once())
138 ->method(
'withAdditionalRelationshipToReferencedResource')
139 ->with(Relationship::LICENSE);
152 protected URI $img_uri
156 public function fullName():
string 166 public function hasImage():
bool 171 public function isImageLink():
bool 176 public function imageLink(): ?
URI 178 return $this->img_uri;
181 public function altText():
string 188 $this->assertSame(2, count($result));
189 $this->assertInstanceOf(Icon::class, $result[0]);
190 $this->assertInstanceOf(Link::class, $result[1]);
193 'icon_src' =>
'image link',
194 'icon_alt' =>
'alt text',
195 'link_label' =>
'full name',
196 'link_action' =>
'link',
197 'legacy_text' =>
null 215 $this->assertSame(0, count($result));
233 public function fullName():
string 238 public function hasImage():
bool 243 public function isImageLink():
bool 248 public function imageLink(): ?
URI 253 public function altText():
string 260 $this->assertSame(2, count($result));
261 $this->assertInstanceOf(Icon::class, $result[0]);
262 $this->assertInstanceOf(Content::class, $result[1]);
265 'icon_src' =>
'image link',
266 'icon_alt' =>
'alt text',
267 'link_label' =>
null,
268 'link_action' =>
null,
269 'legacy_text' =>
'full name' 278 $link->expects($this->once())
279 ->method(
'withAdditionalRelationshipToReferencedResource')
280 ->with(Relationship::LICENSE);
294 public function fullName():
string 306 $this->assertSame(1, count($result));
307 $this->assertInstanceOf(Link::class, $result[0]);
312 'link_label' =>
'full name',
313 'link_action' =>
'link',
314 'legacy_text' =>
null 323 $link->expects($this->once())
324 ->method(
'withAdditionalRelationshipToReferencedResource')
325 ->with(Relationship::LICENSE);
346 $this->assertSame(1, count($result));
347 $this->assertInstanceOf(Link::class, $result[0]);
352 'link_label' =>
'link',
353 'link_action' =>
'link',
354 'legacy_text' =>
null 375 public function hasImage():
bool 380 public function isImageLink():
bool 385 public function imageLink(): ?
URI 390 public function altText():
string 397 $this->assertSame(1, count($result));
398 $this->assertInstanceOf(Icon::class, $result[0]);
401 'icon_src' =>
'image link',
402 'icon_alt' =>
'alt text',
403 'link_label' =>
null,
404 'link_action' =>
null,
405 'legacy_text' =>
null 426 public function hasImage():
bool 431 public function imageFile():
string 433 return 'some string';
436 public function altText():
string 443 $this->assertSame(1, count($result));
444 $this->assertInstanceOf(Icon::class, $result[0]);
447 'icon_src' =>
'image link',
448 'icon_alt' =>
'alt text',
449 'link_label' =>
null,
450 'link_action' =>
null,
451 'legacy_text' =>
null 466 public function fallBackToDefaultImage():
bool 473 $this->assertSame(1, count($result));
474 $this->assertInstanceOf(Icon::class, $result[0]);
477 'icon_src' =>
'fallback src',
479 'link_label' =>
null,
480 'link_action' =>
null,
481 'legacy_text' =>
null 496 public function fullName():
string 498 return 'full name of copyright';
508 'full name of copyright',
521 $uri = $this->
getMockURI(
'http://www.example2.com');
527 public function fullName():
string 539 'http://www.example2.com',
552 $uri = $this->
getMockURI(
'http://www.example2.com');
558 public function fullName():
string 560 return 'full name of copyright';
570 'full name of copyright http://www.example2.com',
584 public function fullName():
string
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct()
Constructor setup ILIAS global object public.
link(string $caption, string $href, bool $new_viewport=false)
Relationship
Note that not all valid values of the rel-attribute of anchor tags are included here (see https://htm...