19require_once(
"libs/composer/vendor/autoload.php");
21require_once(__DIR__ .
"/Renderer/ilIndependentTemplate.php");
22require_once(__DIR__ .
"/../../Services/Language/classes/class.ilLanguage.php");
26use ILIAS\UI\Implementaiton\Component as
I;
39use PHPUnit\Framework\TestCase;
41use PHPUnit\Framework\MockObject\MockObject;
145 public function register(
string $name):
void
147 $this->resources[] =
$name;
159 public function txt($a_topic, $a_default_lang_fallback_mod =
""): string
161 $this->requested[] = $a_topic;
197 $this->on_load_code[] = $code;
212 $this->with_stub_renderings = array_map(
function ($component) {
213 return get_class($component);
225 if (in_array(get_class($component), $this->with_stub_renderings)) {
228 return parent::getRendererFor($component);
245 return $component->getCanonicalName();
266 return "This content was manipulated";
291 return "DummyComponent";
302 assert_options(ASSERT_WARNING, 0);
307 assert_options(ASSERT_WARNING, 1);
340 return $this->getMockBuilder(\
ILIAS\Refinery\Factory::class)
341 ->disableOriginalConstructor()
352 return $this->createMock(DataFactory::class);
357 array $with_stub_renderings = []
371 $component_renderer_loader =
new Render\LoaderCachingWrapper(
381 $image_path_resolver,
390 $image_path_resolver,
399 $image_path_resolver,
408 $image_path_resolver,
424 return trim(str_replace([
"\n",
"\r"],
"", $html));
427 public function assertHTMLEquals(
string $expected_html_as_string,
string $html_as_string): void
429 $html =
new DOMDocument();
430 $html->formatOutput =
true;
431 $html->preserveWhiteSpace =
false;
432 $expected =
new DOMDocument();
433 $expected->formatOutput =
true;
434 $expected->preserveWhiteSpace =
false;
435 $html->loadXML($this->normalizeHTML($html_as_string));
436 $expected->loadXML($this->normalizeHTML($expected_html_as_string));
437 $this->assertEquals($expected->saveHTML(), $html->saveHTML());
446 $html = str_replace([
"\n",
"\r",
"\t"],
"", $html);
447 $html = preg_replace(
'# {2,}#',
" ", $html);
448 $html = preg_replace(
'/<!--(.|\s)*?-->/',
'', $html);
449 $html = preg_replace(
"/>(\s+)</",
"><", $html);
450 $html = str_replace(
" >",
">", $html);
451 $html = str_replace(
" <",
"<", $html);
461 $html = preg_replace(
'/il_signal_(\w+)/',
"il_signal...", $html);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
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 ...
Render Loader $component_renderer_loader
getContexts()
Get the contexts that are added via withAdditionalContext where most recently added contexts come las...
Loads renderers for components from the file system.
Registers resources for retreived renderers at a ResourceRegistry.
Provides common functionality for UI tests.
getDecoratedRenderer(Renderer $default)
normalizeHTML(string $html)
assertHTMLEquals(string $expected_html_as_string, string $html_as_string)
brutallyTrimSignals(string $html)
A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output.
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
createId()
Create a fresh unique id.
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 ...
__construct(Render\Loader $component_renderer_loader, array $with_stub_renderings=[])
_getRendererFor(IComponent $component)
array $with_stub_renderings
getRendererFor(IComponent $component)
registerResources(ResourceRegistry $registry)
render(ILIAS\UI\Component\Component $component, ILIAS\UI\Renderer $default_renderer)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getTemplate(string $path, bool $purge_unfilled_vars, bool $purge_unused_blocks)
Get template instance.
toJS($a_lang_key, ilGlobalTemplateInterface $a_tpl=null)
Transfer text to Javascript.
txt($a_topic, $a_default_lang_fallback_mod="")
loadLanguageModule(string $a_module)
Load language module.
getLangKey()
Return lang key.
A component is the most general form of an entity in the UI.
This is how the factory for UI elements looks.
An entity that renders components to a string output.
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.
Interface to templating as it is used in the UI framework.
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Refinery Factory $refinery
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.