19 declare(strict_types=1);
45 return new class ($icon, $link, $legacy, $src_from_irss) extends
Renderer {
50 protected string $src_from_irss
54 protected function getFallBackSrc():
string 56 return 'fallback src';
59 protected function customIcon(
string $src,
string $alt):
Icon 62 $this->icon->checkParams($src, $alt);
66 protected function standardLink(
string $label,
string $action):
Link 69 $this->
link->checkParams($label, $action);
73 protected function textInLegacy(
string $text):
Content 76 $this->
legacy->checkParams($text);
80 protected function getSourceFromIRSS(
string $string_id):
string 82 return $this->src_from_irss;
89 return $this->getMockBuilder(IIcon::class)
90 ->disableOriginalConstructor()
91 ->addMethods([
'checkParams'])
97 return $this->getMockBuilder(ILink::class)
98 ->disableOriginalConstructor()
99 ->onlyMethods([
'withAdditionalRelationshipToReferencedResource'])
100 ->addMethods([
'checkParams'])
106 return $this->getMockBuilder(ILegacy::class)
107 ->disableOriginalConstructor()
108 ->addMethods([
'checkParams'])
114 $uri = $this->getMockBuilder(URI::class)
115 ->disableOriginalConstructor()
117 $uri->method(
'__toString')->willReturn($link);
124 $icon->expects($this->once())
125 ->method(
'checkParams')
126 ->with(
'image link',
'alt text');
128 $link->expects($this->once())
129 ->method(
'checkParams')
130 ->with(
'full name',
'link');
131 $link->expects($this->once())
132 ->method(
'withAdditionalRelationshipToReferencedResource')
133 ->with(Relationship::LICENSE);
146 protected URI $img_uri
150 public function fullName():
string 160 public function hasImage():
bool 165 public function isImageLink():
bool 170 public function imageLink(): ?
URI 172 return $this->img_uri;
175 public function altText():
string 182 $this->assertSame(2, count($result));
183 $this->assertInstanceOf(Icon::class, $result[0]);
184 $this->assertInstanceOf(Link::class, $result[1]);
199 $this->assertSame(0, count($result));
205 $legacy->expects($this->once())
206 ->method(
'checkParams')
210 $icon->expects($this->once())
211 ->method(
'checkParams')
212 ->with(
'image link',
'alt text');
226 public function fullName():
string 231 public function hasImage():
bool 236 public function isImageLink():
bool 241 public function imageLink(): ?
URI 246 public function altText():
string 253 $this->assertSame(2, count($result));
254 $this->assertInstanceOf(Icon::class, $result[0]);
255 $this->assertInstanceOf(Content::class, $result[1]);
261 $link->expects($this->once())
262 ->method(
'checkParams')
263 ->with(
'full name',
'link');
264 $link->expects($this->once())
265 ->method(
'withAdditionalRelationshipToReferencedResource')
266 ->with(Relationship::LICENSE);
280 public function fullName():
string 292 $this->assertSame(1, count($result));
293 $this->assertInstanceOf(Link::class, $result[0]);
299 $link->expects($this->once())
300 ->method(
'checkParams')
301 ->with(
'link',
'link');
302 $link->expects($this->once())
303 ->method(
'withAdditionalRelationshipToReferencedResource')
304 ->with(Relationship::LICENSE);
325 $this->assertSame(1, count($result));
326 $this->assertInstanceOf(Link::class, $result[0]);
332 $icon->expects($this->once())
333 ->method(
'checkParams')
334 ->with(
'image link',
'alt text');
348 public function hasImage():
bool 353 public function isImageLink():
bool 358 public function imageLink(): ?
URI 363 public function altText():
string 370 $this->assertSame(1, count($result));
371 $this->assertInstanceOf(Icon::class, $result[0]);
377 $icon->expects($this->once())
378 ->method(
'checkParams')
379 ->with(
'image link',
'alt text');
393 public function hasImage():
bool 398 public function imageFile():
string 400 return 'some string';
403 public function altText():
string 410 $this->assertSame(1, count($result));
411 $this->assertInstanceOf(Icon::class, $result[0]);
417 $icon->expects($this->once())
418 ->method(
'checkParams')
419 ->with(
'fallback src');
428 public function fallBackToDefaultImage():
bool 435 $this->assertSame(1, count($result));
436 $this->assertInstanceOf(Icon::class, $result[0]);
448 public function fullName():
string 450 return 'full name of copyright';
460 'full name of copyright',
473 $uri = $this->
getMockURI(
'http://www.example2.com');
479 public function fullName():
string 491 'http://www.example2.com',
504 $uri = $this->
getMockURI(
'http://www.example2.com');
510 public function fullName():
string 512 return 'full name of copyright';
522 'full name of copyright http://www.example2.com',
536 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.
legacy()
expected output: > ILIAS shows the rendered Component.
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...