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;
166 $this->on_load_code[] = $code;
182 $this->with_stub_renderings = array_map(
function ($component) {
183 return get_class($component);
195 if (in_array(get_class($component), $this->with_stub_renderings)) {
198 return parent::getRendererFor($component);
214 return $component->getCanonicalName();
230 return "This content was manipulated";
255 return "DummyComponent";
266 assert_options(ASSERT_WARNING, 0);
271 assert_options(ASSERT_WARNING, 1);
301 return $this->getMockBuilder(\
ILIAS\Refinery\Factory::class)
302 ->disableOriginalConstructor()
365 return trim(str_replace([
"\n",
"\r"],
"", $html));
374 $html =
new DOMDocument();
375 $html->formatOutput =
true;
376 $html->preserveWhiteSpace =
false;
377 $expected =
new DOMDocument();
378 $expected->formatOutput =
true;
379 $expected->preserveWhiteSpace =
false;
381 $expected->loadXML($this->
normalizeHTML($expected_html_as_string));
382 $this->assertEquals($expected->saveHTML(), $html->saveHTML());
394 $html = str_replace([
"\n",
"\r",
"\t"],
"", $html);
395 $html = preg_replace(
'# {2,}#',
" ", $html);
396 $html = preg_replace(
'/<!--(.|\s)*?-->/',
'', $html);
397 $html = preg_replace(
"/>(\s+)</",
"><", $html);
398 $html = str_replace(
" >",
">", $html);
399 $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...
$component_renderer_loader
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, $with_stub_renderings=[])
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)
getRendererFor(IComponent $component)
__construct(Render\Loader $component_renderer_loader, $with_stub_renderings=[])
render($component, ?Renderer $root=null)
Render given component.If an array of components is passed, this method returns a concatenated output...
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.
Loads renderers for components.
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.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ChatMainBarProvider \MainMenu\Provider.