5require_once(
"libs/composer/vendor/autoload.php");
7require_once(__DIR__ .
"/Renderer/ilIndependentTemplate.php");
8require_once(__DIR__ .
"/../../Services/Language/classes/class.ilLanguage.php");
12use ILIAS\UI\Implementaiton\Component as I;
19use ILIAS\UI\Implementation\ComponentRendererFSLoader;
25use PHPUnit\Framework\TestCase;
29 public function getTemplate($path, $purge_unfilled_vars, $purge_unused_blocks)
46 public function deck(array $cards)
123 $this->resources[] =
$name;
133 public function txt($a_topic, $a_default_lang_fallback_mod =
"")
135 $this->requested[] = $a_topic;
161 $this->on_load_code[] = $code;
192 return "This content was manipulated";
217 return "DummyComponent";
228 assert_options(ASSERT_WARNING, 0);
233 assert_options(ASSERT_WARNING, 1);
263 return $this->getMockBuilder(\
ILIAS\Refinery\Factory::class)
264 ->disableOriginalConstructor()
280 $component_renderer_loader
319 return trim(str_replace([
"\n",
"\r"],
"", $html));
328 $html =
new DOMDocument();
329 $html->formatOutput =
true;
330 $html->preserveWhiteSpace =
false;
331 $expected =
new DOMDocument();
332 $expected->formatOutput =
true;
333 $expected->preserveWhiteSpace =
false;
335 $expected->loadXML($this->
normalizeHTML($expected_html_as_string));
336 $this->assertEquals($expected->saveHTML(), $html->saveHTML());
348 $html = str_replace([
"\n",
"\r",
"\t"],
"", $html);
349 $html = preg_replace(
'# {2,}#',
" ", $html);
350 $html = str_replace(
"> <",
"><", $html);
351 $html = str_replace(
" >",
">", $html);
An exception for terminatinating execution or to throw for unit testing.
getCanonicalName()
Get the canonical name of the component.
Renderer that dispatches rendering of UI components to a Renderer found in the same namespace as the ...
getContexts()
Get the contexts that are added via withAdditionalContext where most recently added contexts come las...
getRendererFor(Component $component)
Get a renderer for a certain Component class.
Loads renderers for components from the file system.
Caches renderers loaded by another loader.
Registers resources for retreived renderers at a ResourceRegistry.
Provides common functionality for UI tests.
getDecoratedRenderer(Renderer $default)
assertHTMLEquals($expected_html_as_string, $html_as_string)
getDefaultRenderer(JavaScriptBinding $js_binding=null)
brutallyTrimHTML($html)
A more radical version of normalizeHTML.
createId()
Create a fresh unique id.
addOnLoadCode($code)
Add some JavaScript-statements to the on-load handler of the page.
getOnLoadCodeAsync()
Get all the registered on-load javascript code for the async context, e.g.
breadcrumbs(array $crumbs)
manipulateRendering($component, Renderer $root)
Manipulates the rendering of one or multiple components by appending, prepending or exchanging their ...
_getRendererFor(IComponent $component)
getTemplate($path, $purge_unfilled_vars, $purge_unused_blocks)
Get template instance.
toJS($a_lang_key, ilGlobalTemplateInterface $a_tpl=null)
txt($a_topic, $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
loadLanguageModule($lang_module)
A component is the most general form of an entity in the UI.
This is how the factory for UI elements looks.
Provides methods to interface with javascript.
Registry for resources required by rendered output like Javascript or CSS.
Interface for a factory that provides templates.
An entity that renders components to a string output.
Class ChatMainBarProvider \MainMenu\Provider.