ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 (JavaScriptBinding $js_binding=null)
 
 normalizeHTML ($html)
 
 assertHTMLEquals ($expected_html_as_string, $html_as_string)
 

Detailed Description

Provides common functionality for UI tests.

Definition at line 191 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 270 of file Base.php.

References $html.

Referenced by ButtonMonthTest\test_render(), ChartScaleBarTest\test_render(), CheckboxInputTest\test_render(), RadioInputTest\test_render(), MultiSelectInputTest\test_render(), PanelListingTest\test_render_base(), ItemGroupTest\test_render_base(), ItemTest\test_render_base(), ButtonTest\test_render_button_disabled(), ButtonTest\test_render_button_label(), ButtonTest\test_render_button_with_aria_checked(), ButtonTest\test_render_button_with_aria_label(), ButtonTest\test_render_button_with_on_click_animation(), ButtonTest\test_render_button_with_on_load_code(), ButtonTest\test_render_button_with_signal(), DeckTest\test_render_content(), CardTest\test_render_content_full(), CardTest\test_render_content_with_highlight(), CheckboxInputTest\test_render_error(), ChartProgressMeterTest\test_render_fixedSize_one_bar(), DividerTest\test_render_horizontal_empty(), DividerTest\test_render_horizontal_with_label(), DropdownTest\test_render_items(), DropdownTest\test_render_items_with_aria_label(), DropdownTest\test_render_items_with_label(), ItemTest\test_render_lead_icon(), ItemTest\test_render_lead_image(), ItemTest\test_render_lead_text_and_color(), LinkTest\test_render_link(), ChartProgressMeterTest\test_render_mini(), CheckboxInputTest\test_render_no_byline(), CheckboxInputTest\test_render_required(), ToggleButtonTest\test_render_setOn_on_default(), MessageBoxTest\test_render_simple(), ChartProgressMeterTest\test_render_standard_two_bar(), RadioInputTest\test_render_value(), CheckboxInputTest\test_render_value(), MultiSelectInputTest\test_render_value(), DividerTest\test_render_vertical(), ViewControlTest\test_render_viewcontrol_mode(), ViewControlTest\test_render_viewcontrol_section(), ItemGroupTest\test_render_with_actions(), PanelListingTest\test_render_with_actions(), RepositoryObjectTest\test_render_with_actions(), MessageBoxTest\test_render_with_buttons(), MessageBoxTest\test_render_with_buttons_and_links(), RepositoryObjectTest\test_render_with_certificate_icon(), BulkyButtonTest\test_render_with_glyph_in_context(), BulkyButtonTest\test_render_with_glyph_in_context_and_engaged(), BulkyButtonTest\test_render_with_icon(), ToggleButtonTest\test_render_with_label(), MessageBoxTest\test_render_with_links(), LinkTest\test_render_with_new_viewport(), RepositoryObjectTest\test_render_with_object_icon(), RepositoryObjectTest\test_render_with_progressmeter(), ToggleButtonTest\test_render_with_signals(), TextareaTest\test_renderer(), TextareaTest\test_renderer_counter_with_value(), TextareaTest\test_renderer_with_max_limit(), TextareaTest\test_renderer_with_min_and_max_limit(), TextareaTest\test_renderer_with_min_limit(), ItemTest\test_shy_title_and_property(), RoundTripTest\test_simple_rendering(), PresentationTest\testBareTableRendering(), PaginationTest\testRenderDropdown(), BreadcrumbsTest\testRendering(), PaginationTest\testRenderLimited(), PaginationTest\testRenderLimitedWithCurrentPage(), PaginationTest\testRenderLimitedWithCurrentPage2(), PaginationTest\testRenderUnlimited(), and PaginationTest\testRenderWithCurrentPage().

271  {
272  $html = new DOMDocument();
273  $html->formatOutput = true;
274  $html->preserveWhiteSpace = false;
275  $expected = new DOMDocument();
276  $expected->formatOutput = true;
277  $expected->preserveWhiteSpace = false;
278  $html->loadXML($this->normalizeHTML($html_as_string));
279  $expected->loadXML($this->normalizeHTML($expected_html_as_string));
280  $this->assertEquals($expected->saveHTML(), $html->saveHTML());
281  }
normalizeHTML($html)
Definition: Base.php:261
$html
Definition: example_001.php:87
+ Here is the caller graph for this function:

◆ getDefaultRenderer()

ILIAS_UI_TestBase::getDefaultRenderer ( JavaScriptBinding  $js_binding = null)

Definition at line 228 of file Base.php.

References $lng.

Referenced by ButtonTest\test_____render_close_button_with_on_load_code(), LightboxTest\test_different_page_type_rendering(), GlyphTest\test_dont_render_counter(), DefaultRendererTest\test_getContexts(), DefaultRendererTest\test_getRenderer_caching(), DefaultRendererTest\test_getRenderer_successfully(), DefaultRendererTest\test_invokesRegistry(), ButtonMonthTest\test_render(), NumericInputTest\test_render(), TextInputTest\test_render(), ChartScaleBarTest\test_render(), CheckboxInputTest\test_render(), RadioInputTest\test_render(), TagInputTest\test_render(), MultiSelectInputTest\test_render(), DefaultRendererTest\test_render(), ImageTest\test_render_alt_escaping(), PopoverTest\test_render_async(), DefaultRendererTest\test_render_async_array(), DefaultRendererTest\test_render_async_no_js(), DefaultRendererTest\test_render_async_with_js(), DefaultRendererTest\test_render_async_with_js_twice(), PanelListingTest\test_render_base(), ItemGroupTest\test_render_base(), ItemTest\test_render_base(), ButtonTest\test_render_btn_tag_classes(), ButtonTest\test_render_btn_tag_colors(), ButtonTest\test_render_btn_tag_relevance(), ButtonTest\test_render_button_disabled(), ButtonTest\test_render_button_label(), ButtonTest\test_render_button_with_aria_checked(), ButtonTest\test_render_button_with_aria_label(), ButtonTest\test_render_button_with_on_click_animation(), ButtonTest\test_render_button_with_on_load_code(), ButtonTest\test_render_button_with_signal(), ButtonTest\test_render_close_button(), LegacyTest\test_render_content(), DeckTest\test_render_content(), CardTest\test_render_content_full(), CardTest\test_render_content_with_highlight(), ListingTest\test_render_descriptive_listing(), DropdownTest\test_render_empty(), CheckboxInputTest\test_render_error(), NumericInputTest\test_render_error(), TextInputTest\test_render_error(), TagInputTest\test_render_error(), ChartProgressMeterTest\test_render_fixedSize_one_bar(), DividerTest\test_render_horizontal_empty(), DividerTest\test_render_horizontal_with_label(), DropdownTest\test_render_items(), DropdownTest\test_render_items_with_aria_label(), DropdownTest\test_render_items_with_label(), ItemTest\test_render_lead_icon(), ItemTest\test_render_lead_image(), ItemTest\test_render_lead_text_and_color(), LinkTest\test_render_link(), ChartProgressMeterTest\test_render_mini(), CheckboxInputTest\test_render_no_byline(), NumericInputTest\test_render_no_byline(), TextInputTest\test_render_no_byline(), TagInputTest\test_render_no_byline(), ListingTest\test_render_ordered_listing(), CheckboxInputTest\test_render_required(), TextInputTest\test_render_required(), TagInputTest\test_render_required(), ImageTest\test_render_responsive(), ToggleButtonTest\test_render_setOn_on_default(), MessageBoxTest\test_render_simple(), GlyphTest\test_render_simple(), PopoverTest\test_render_standard(), ImageTest\test_render_standard(), ChartProgressMeterTest\test_render_standard_two_bar(), CounterTest\test_render_status(), ListingTest\test_render_unordered_listing(), RadioInputTest\test_render_value(), CheckboxInputTest\test_render_value(), NumericInputTest\test_render_value(), TextInputTest\test_render_value(), TagInputTest\test_render_value(), MultiSelectInputTest\test_render_value(), DividerTest\test_render_vertical(), ViewControlTest\test_render_viewcontrol_mode(), ViewControlTest\test_render_viewcontrol_section(), ItemGroupTest\test_render_with_actions(), PanelListingTest\test_render_with_actions(), RepositoryObjectTest\test_render_with_actions(), MessageBoxTest\test_render_with_buttons(), MessageBoxTest\test_render_with_buttons_and_links(), RepositoryObjectTest\test_render_with_certificate_icon(), BulkyButtonTest\test_render_with_glyph_in_context(), BulkyButtonTest\test_render_with_glyph_in_context_and_engaged(), BulkyButtonTest\test_render_with_icon(), ToggleButtonTest\test_render_with_label(), MessageBoxTest\test_render_with_links(), LinkTest\test_render_with_new_viewport(), RepositoryObjectTest\test_render_with_object_icon(), GlyphTest\test_render_with_on_load_code(), RepositoryObjectTest\test_render_with_progressmeter(), ImageTest\test_render_with_signal_action(), ToggleButtonTest\test_render_with_signals(), ImageTest\test_render_with_string_action(), GlyphTest\test_render_with_unavailable_action(), GlyphTest\test_render_withCounter(), GlyphTest\test_render_withTwoCounters(), TextareaTest\test_renderer(), TextareaTest\test_renderer_counter_with_value(), TextareaTest\test_renderer_with_error(), TextareaTest\test_renderer_with_max_limit(), TextareaTest\test_renderer_with_min_and_max_limit(), TextareaTest\test_renderer_with_min_limit(), ItemTest\test_shy_title_and_property(), LightboxTest\test_simple_image_page_rendering(), RoundTripTest\test_simple_rendering(), InterruptiveTest\test_simple_rendering(), LightboxTest\test_simple_text_page_rendering(), ViewControlTest\test_viewcontrol_get_actions(), RadioInputTest\test_with_dependant(), DefaultRendererTest\test_withAdditionalContext_clones(), PresentationTest\testBareTableRendering(), LSLocatorBuilderTest\testGUI(), PaginationTest\testRenderDropdown(), SortationTest\testRendering(), BreadcrumbsTest\testRendering(), IconTest\testRenderingCustom(), IconTest\testRenderingStandard(), IconTest\testRenderingStandardOutlined(), PaginationTest\testRenderLimited(), PaginationTest\testRenderLimitedWithCurrentPage(), PaginationTest\testRenderLimitedWithCurrentPage2(), DropzoneRendererTest\testRenderMetadata(), DropzoneRendererTest\testRenderStandardDropzone(), DropzoneRendererTest\testRenderStandardDropzoneWithMessage(), PaginationTest\testRenderUnlimited(), PaginationTest\testRenderWithCurrentPage(), DropzoneRendererTest\testRenderWrapperDropzone(), and DropzoneRendererTest\testWithButton().

229  {
230  $ui_factory = $this->getUIFactory();
231  $tpl_factory = $this->getTemplateFactory();
232  $resource_registry = $this->getResourceRegistry();
233  $lng = $this->getLanguage();
234  if (!$js_binding) {
235  $js_binding = $this->getJavaScriptBinding();
236  }
237 
238  $component_renderer_loader
239  = new Render\LoaderCachingWrapper(
241  $resource_registry,
242  new Render\FSLoader(
244  $ui_factory,
245  $tpl_factory,
246  $lng,
247  $js_binding
248  ),
250  $ui_factory,
251  $tpl_factory,
252  $lng,
253  $js_binding
254  )
255  )
256  )
257  );
258  return new TestDefaultRenderer($component_renderer_loader);
259  }
Loads renderers for components from the file system.
Definition: FSLoader.php:20
Registers resources for retreived renderers at a ResourceRegistry.
getJavaScriptBinding()
Definition: Base.php:223
$lng
getTemplateFactory()
Definition: Base.php:208
getResourceRegistry()
Definition: Base.php:213
+ Here is the caller graph for this function:

◆ getJavaScriptBinding()

ILIAS_UI_TestBase::getJavaScriptBinding ( )

Definition at line 223 of file Base.php.

Referenced by GlyphTest\test_dont_render_counter().

224  {
225  return new LoggingJavaScriptBinding();
226  }
+ Here is the caller graph for this function:

◆ getLanguage()

ILIAS_UI_TestBase::getLanguage ( )

Definition at line 218 of file Base.php.

Referenced by NumericInputTest\buildFactory(), and GlyphTest\test_dont_render_counter().

219  {
220  return new ilLanguageMock();
221  }
+ Here is the caller graph for this function:

◆ getResourceRegistry()

ILIAS_UI_TestBase::getResourceRegistry ( )

Definition at line 213 of file Base.php.

214  {
215  return new LoggingRegistry();
216  }

◆ getTemplateFactory()

◆ getUIFactory()

ILIAS_UI_TestBase::getUIFactory ( )

Definition at line 203 of file Base.php.

Referenced by GlyphTest\test_dont_render_counter().

204  {
205  return new NoUIFactory();
206  }
+ Here is the caller graph for this function:

◆ normalizeHTML()

ILIAS_UI_TestBase::normalizeHTML (   $html)

Definition at line 261 of file Base.php.

References $html.

Referenced by SortationTest\getSortationExpectedHTML(), LSLocatorBuilderTest\stripHTML(), ButtonTest\test_____render_close_button_with_on_load_code(), TextInputTest\test_render(), NumericInputTest\test_render(), TagInputTest\test_render(), ImageTest\test_render_alt_escaping(), ButtonTest\test_render_btn_tag_classes(), ButtonTest\test_render_btn_tag_colors(), ButtonTest\test_render_btn_tag_relevance(), ButtonTest\test_render_button_disabled(), ButtonTest\test_render_button_label(), ButtonTest\test_render_button_with_aria_checked(), ButtonTest\test_render_button_with_aria_label(), ButtonTest\test_render_button_with_on_click_animation(), ButtonTest\test_render_button_with_on_load_code(), ButtonTest\test_render_button_with_signal(), ButtonTest\test_render_close_button(), ListingTest\test_render_descriptive_listing(), TextInputTest\test_render_error(), NumericInputTest\test_render_error(), TagInputTest\test_render_error(), TextInputTest\test_render_no_byline(), NumericInputTest\test_render_no_byline(), TagInputTest\test_render_no_byline(), ListingTest\test_render_ordered_listing(), TextInputTest\test_render_required(), TagInputTest\test_render_required(), ImageTest\test_render_responsive(), MessageBoxTest\test_render_simple(), GlyphTest\test_render_simple(), PopoverTest\test_render_standard(), ImageTest\test_render_standard(), CounterTest\test_render_status(), ListingTest\test_render_unordered_listing(), NumericInputTest\test_render_value(), TextInputTest\test_render_value(), TagInputTest\test_render_value(), ViewControlTest\test_render_viewcontrol_mode(), MessageBoxTest\test_render_with_buttons(), MessageBoxTest\test_render_with_buttons_and_links(), MessageBoxTest\test_render_with_links(), GlyphTest\test_render_with_on_load_code(), ImageTest\test_render_with_signal_action(), ImageTest\test_render_with_string_action(), GlyphTest\test_render_with_unavailable_action(), GlyphTest\test_render_withCounter(), GlyphTest\test_render_withTwoCounters(), TextareaTest\test_renderer(), TextareaTest\test_renderer_counter_with_value(), TextareaTest\test_renderer_with_error(), TextareaTest\test_renderer_with_max_limit(), TextareaTest\test_renderer_with_min_and_max_limit(), TextareaTest\test_renderer_with_min_limit(), SortationTest\testRendering(), BreadcrumbsTest\testRendering(), IconTest\testRenderingCustom(), IconTest\testRenderingStandard(), and IconTest\testRenderingStandardOutlined().

262  {
263  return trim(str_replace("\n", "", $html));
264  }
$html
Definition: example_001.php:87
+ Here is the caller graph for this function:

◆ setUp()

ILIAS_UI_TestBase::setUp ( )

Definition at line 193 of file Base.php.

194  {
195  assert_options(ASSERT_WARNING, 0);
196  }

◆ tearDown()

ILIAS_UI_TestBase::tearDown ( )

Definition at line 198 of file Base.php.

199  {
200  assert_options(ASSERT_WARNING, 1);
201  }

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