ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
LinkTest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for LinkTest:
+ Collaboration diagram for LinkTest:

Public Member Functions

 getLinkFactory ()
 
 test_implements_factory_interface ()
 
 test_get_label ()
 
 test_get_action ()
 
 test_render_link ()
 
 test_render_with_new_viewport ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDataFactory ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML (string $html)
 
 assertHTMLEquals (string $expected_html_as_string, string $html_as_string)
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML (string $html)
 A more radical version of normalizeHTML. More...
 
 brutallyTrimSignals (string $html)
 A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output. More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Test on link implementation.

Definition at line 29 of file LinkTest.php.

Member Function Documentation

◆ getLinkFactory()

LinkTest::getLinkFactory ( )

Definition at line 31 of file LinkTest.php.

Referenced by test_get_action(), test_get_label(), test_implements_factory_interface(), test_render_link(), and test_render_with_new_viewport().

31  : I\Link\Factory
32  {
33  return new I\Link\Factory();
34  }
+ Here is the caller graph for this function:

◆ test_get_action()

LinkTest::test_get_action ( )

Definition at line 55 of file LinkTest.php.

References $c, Vendor\Package\$f, and getLinkFactory().

55  : void
56  {
57  $f = $this->getLinkFactory();
58  $c = $f->standard("label", "http://www.ilias.de");
59 
60  $this->assertEquals("http://www.ilias.de", $c->getAction());
61  }
$c
Definition: cli.php:38
getLinkFactory()
Definition: LinkTest.php:31
+ Here is the call graph for this function:

◆ test_get_label()

LinkTest::test_get_label ( )

Definition at line 47 of file LinkTest.php.

References $c, Vendor\Package\$f, and getLinkFactory().

47  : void
48  {
49  $f = $this->getLinkFactory();
50  $c = $f->standard("label", "http://www.ilias.de");
51 
52  $this->assertEquals("label", $c->getLabel());
53  }
$c
Definition: cli.php:38
getLinkFactory()
Definition: LinkTest.php:31
+ Here is the call graph for this function:

◆ test_implements_factory_interface()

LinkTest::test_implements_factory_interface ( )

Definition at line 36 of file LinkTest.php.

References Vendor\Package\$f, and getLinkFactory().

36  : void
37  {
38  $f = $this->getLinkFactory();
39 
40  $this->assertInstanceOf("ILIAS\\UI\\Component\\Link\\Factory", $f);
41  $this->assertInstanceOf(
42  "ILIAS\\UI\\Component\\Link\\Standard",
43  $f->standard("label", "http://www.ilias.de")
44  );
45  }
getLinkFactory()
Definition: LinkTest.php:31
+ Here is the call graph for this function:

◆ test_render_link()

LinkTest::test_render_link ( )

Definition at line 63 of file LinkTest.php.

References $c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), and getLinkFactory().

63  : void
64  {
65  $f = $this->getLinkFactory();
66  $r = $this->getDefaultRenderer();
67 
68  $c = $f->standard("label", "http://www.ilias.de");
69 
70  $html = $r->render($c);
71 
72  $expected_html =
73  '<a href="http://www.ilias.de">label</a>';
74 
75  $this->assertHTMLEquals($expected_html, $html);
76  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355
$c
Definition: cli.php:38
getLinkFactory()
Definition: LinkTest.php:31
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
Definition: Base.php:427
+ Here is the call graph for this function:

◆ test_render_with_new_viewport()

LinkTest::test_render_with_new_viewport ( )

Definition at line 78 of file LinkTest.php.

References $c, Vendor\Package\$f, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), and getLinkFactory().

78  : void
79  {
80  $f = $this->getLinkFactory();
81  $r = $this->getDefaultRenderer();
82 
83  $c = $f->standard("label", "http://www.ilias.de")->withOpenInNewViewport(true);
84 
85  $html = $r->render($c);
86 
87  $expected_html =
88  '<a href="http://www.ilias.de" target="_blank" rel="noopener">label</a>';
89 
90  $this->assertHTMLEquals($expected_html, $html);
91  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:355
$c
Definition: cli.php:38
getLinkFactory()
Definition: LinkTest.php:31
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
Definition: Base.php:427
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: