ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ILIAS_UI_TestBase Class Reference

Provides common functionality for UI tests. More...

+ Inheritance diagram for ILIAS_UI_TestBase:
+ Collaboration diagram for ILIAS_UI_TestBase:

Public Member Functions

 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getDefaultRenderer ()
 
 normalizeHTML ($html)
 
 assertHTMLEquals ($expected_html_as_string, $html_as_string)
 

Detailed Description

Provides common functionality for UI tests.

Definition at line 69 of file Base.php.

Member Function Documentation

◆ assertHTMLEquals()

ILIAS_UI_TestBase::assertHTMLEquals (   $expected_html_as_string,
  $html_as_string 
)
Parameters
string$expected_html_as_string
string$html_as_string

Definition at line 118 of file Base.php.

References $html.

Referenced by DeckTest\test_render_content(), CardTest\test_render_content_empty(), and CardTest\test_render_content_full().

118  {
119  $html = new DOMDocument();
120  $html->formatOutput = true;
121  $html->preserveWhiteSpace = false;
122  $expected = new DOMDocument();
123  $expected->formatOutput = true;
124  $expected->preserveWhiteSpace = false;
125  $html->loadXML($this->normalizeHTML($html_as_string));
126  $expected->loadXML($this->normalizeHTML($expected_html_as_string));
127  $this->assertEquals($expected->saveHTML(), $html->saveHTML());
128  }
normalizeHTML($html)
Definition: Base.php:110
$html
Definition: example_001.php:87
+ Here is the caller graph for this function:

◆ getDefaultRenderer()

ILIAS_UI_TestBase::getDefaultRenderer ( )

Definition at line 100 of file Base.php.

References $lng.

Referenced by ButtonTest\test_____render_close_button_with_on_load_code(), GlyphTest\test_dont_render_counter(), ImageTest\test_render_alt_escaping(), ButtonTest\test_render_button_disabled(), ButtonTest\test_render_button_label(), ButtonTest\test_render_button_with_on_load_code(), ButtonTest\test_render_close_button(), LegacyTest\test_render_content(), DeckTest\test_render_content(), CardTest\test_render_content_empty(), CardTest\test_render_content_full(), ListingTest\test_render_descriptive_listing(), ListingTest\test_render_ordered_listing(), ImageTest\test_render_responsive(), GlyphTest\test_render_simple(), ImageTest\test_render_standard(), CounterTest\test_render_status(), ListingTest\test_render_unordered_listing(), GlyphTest\test_render_with_on_load_code(), GlyphTest\test_render_withCounter(), and GlyphTest\test_render_withTwoCounters().

100  {
101  $ui_factory = $this->getUIFactory();
102  $tpl_factory = $this->getTemplateFactory();
103  $resource_registry = $this->getResourceRegistry();
104  $lng = $this->getLanguage();
105  $js_binding = $this->getJavaScriptBinding();
106  return new DefaultRenderer(
107  $ui_factory, $tpl_factory, $resource_registry, $lng, $js_binding);
108  }
getJavaScriptBinding()
Definition: Base.php:96
getTemplateFactory()
Definition: Base.php:84
getResourceRegistry()
Definition: Base.php:88
global $lng
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ getJavaScriptBinding()

ILIAS_UI_TestBase::getJavaScriptBinding ( )

Definition at line 96 of file Base.php.

Referenced by GlyphTest\test_dont_render_counter().

96  {
97  return new LoggingJavaScriptBinding();
98  }
+ Here is the caller graph for this function:

◆ getLanguage()

ILIAS_UI_TestBase::getLanguage ( )

Definition at line 92 of file Base.php.

Referenced by GlyphTest\test_dont_render_counter().

92  {
93  return new ilLanguageMock();
94  }
+ Here is the caller graph for this function:

◆ getResourceRegistry()

ILIAS_UI_TestBase::getResourceRegistry ( )

Definition at line 88 of file Base.php.

88  {
89  return new LoggingRegistry();
90  }

◆ getTemplateFactory()

ILIAS_UI_TestBase::getTemplateFactory ( )

Definition at line 84 of file Base.php.

Referenced by GlyphTest\test_dont_render_counter().

84  {
85  return new ilIndependentTemplateFactory();
86  }
+ Here is the caller graph for this function:

◆ getUIFactory()

ILIAS_UI_TestBase::getUIFactory ( )

Definition at line 80 of file Base.php.

Referenced by GlyphTest\test_dont_render_counter().

80  {
81  return new NoUIFactory();
82  }
+ Here is the caller graph for this function:

◆ normalizeHTML()

◆ setUp()

ILIAS_UI_TestBase::setUp ( )

Definition at line 70 of file Base.php.

70  {
71  assert_options(ASSERT_WARNING, 0);
72  assert_options(ASSERT_CALLBACK, null);
73  }

◆ tearDown()

ILIAS_UI_TestBase::tearDown ( )

Definition at line 75 of file Base.php.

75  {
76  assert_options(ASSERT_WARNING, 1);
77  assert_options(ASSERT_CALLBACK, null);
78  }

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