ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
LinkTest Class Reference

Test on link implementation. 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 ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null)
 
 normalizeHTML ($html)
 
 assertHTMLEquals ($expected_html_as_string, $html_as_string)
 

Detailed Description

Test on link implementation.

Definition at line 13 of file LinkTest.php.

Member Function Documentation

◆ getLinkFactory()

LinkTest::getLinkFactory ( )

Definition at line 15 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().

16  {
17  return new \ILIAS\UI\Implementation\Component\Link\Factory();
18  }
+ Here is the caller graph for this function:

◆ test_get_action()

LinkTest::test_get_action ( )

Definition at line 39 of file LinkTest.php.

References $c, $f, and getLinkFactory().

40  {
41  $f = $this->getLinkFactory();
42  $c = $f->standard("label", "http://www.ilias.de");
43 
44  $this->assertEquals($c->getAction(), "http://www.ilias.de");
45  }
getLinkFactory()
Definition: LinkTest.php:15
+ Here is the call graph for this function:

◆ test_get_label()

LinkTest::test_get_label ( )

Definition at line 31 of file LinkTest.php.

References $c, $f, and getLinkFactory().

32  {
33  $f = $this->getLinkFactory();
34  $c = $f->standard("label", "http://www.ilias.de");
35 
36  $this->assertEquals($c->getLabel(), "label");
37  }
getLinkFactory()
Definition: LinkTest.php:15
+ Here is the call graph for this function:

◆ test_implements_factory_interface()

LinkTest::test_implements_factory_interface ( )

Definition at line 20 of file LinkTest.php.

References $f, and getLinkFactory().

21  {
22  $f = $this->getLinkFactory();
23 
24  $this->assertInstanceOf("ILIAS\\UI\\Component\\Link\\Factory", $f);
25  $this->assertInstanceOf(
26  "ILIAS\\UI\\Component\\Link\\Standard",
27  $f->standard("label", "http://www.ilias.de")
28  );
29  }
getLinkFactory()
Definition: LinkTest.php:15
+ Here is the call graph for this function:

◆ test_render_link()

LinkTest::test_render_link ( )

Definition at line 47 of file LinkTest.php.

References $c, $f, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), and getLinkFactory().

48  {
49  $f = $this->getLinkFactory();
50  $r = $this->getDefaultRenderer();
51 
52  $c = $f->standard("label", "http://www.ilias.de");
53 
54  $html = $r->render($c);
55 
56  $expected_html =
57  '<a href="http://www.ilias.de">label</a>';
58 
59  $this->assertHTMLEquals($expected_html, $html);
60  }
getLinkFactory()
Definition: LinkTest.php:15
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:228
$r
Definition: example_031.php:79
assertHTMLEquals($expected_html_as_string, $html_as_string)
Definition: Base.php:270
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ test_render_with_new_viewport()

LinkTest::test_render_with_new_viewport ( )

Definition at line 62 of file LinkTest.php.

References $c, $f, $html, $r, ILIAS_UI_TestBase\assertHTMLEquals(), ILIAS_UI_TestBase\getDefaultRenderer(), and getLinkFactory().

63  {
64  $f = $this->getLinkFactory();
65  $r = $this->getDefaultRenderer();
66 
67  $c = $f->standard("label", "http://www.ilias.de")->withOpenInNewViewport(true);
68 
69  $html = $r->render($c);
70 
71  $expected_html =
72  '<a href="http://www.ilias.de" target="_blank" rel="noopener">label</a>';
73 
74  $this->assertHTMLEquals($expected_html, $html);
75  }
getLinkFactory()
Definition: LinkTest.php:15
getDefaultRenderer(JavaScriptBinding $js_binding=null)
Definition: Base.php:228
$r
Definition: example_031.php:79
assertHTMLEquals($expected_html_as_string, $html_as_string)
Definition: Base.php:270
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

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