5 require_once(__DIR__ .
"/../../../../libs/composer/vendor/autoload.php");
6 require_once(__DIR__ .
"/../../Base.php");
8 use \ILIAS\UI\Component as
C;
9 use \ILIAS\UI\Implementation\Component as
IC;
18 $factory =
new class extends NoUIFactory {
19 public function legacy($content)
21 return new IC\Legacy\Legacy($content,
new IC\SignalGenerator());
31 $this->assertInstanceOf(
"ILIAS\\UI\\Factory",
$f);
32 $this->assertInstanceOf(
33 "ILIAS\\UI\\Component\\Legacy\\Legacy",
34 $f->legacy(
"Legacy Content")
41 $g =
$f->legacy(
"Legacy Content");
43 $this->assertEquals($g->getContent(),
"Legacy Content");
52 $g =
$f->legacy(
"Legacy Content");
54 $this->assertEquals($r->render($g),
"Legacy Content");
63 $signal_name =
'Custom Signal';
65 $g =
$f->legacy(
'')->withCustomSignal($signal_name,
'');
71 $signal_name =
'Custom Signal';
72 $g =
$f->legacy(
'')->withCustomSignal($signal_name,
'');
74 $this->assertNotNull($g->getCustomSignal($signal_name));
80 $signal_name =
'Custom Signal';
83 $this->expectException(InvalidArgumentException::class);
84 $this->expectExceptionMessage(
"Signal with name $signal_name is not registered");
85 $g->getCustomSignal($signal_name);
91 $signal_name_1 =
'Custom Signal 1';
92 $signal_name_2 =
'Custom Signal 2';
94 $g =
$f->legacy(
'')->withCustomSignal($signal_name_1,
'')->withCustomSignal($signal_name_2,
'');
95 $l = $g->getAllCustomSignals();
97 $this->assertIsArray($l);
103 $signal_name_1 =
'Custom Signal 1';
104 $custom_code_1 =
'custom_js1();';
105 $signal_name_2 =
'Custom Signal 2';
106 $custom_code_2 =
'custom_js2();';
109 ->withCustomSignal($signal_name_1, $custom_code_1)
110 ->withCustomSignal($signal_name_2, $custom_code_2);
111 $signal_list = $g->getAllCustomSignals();
113 $this->assertEquals(count($signal_list), 2);
114 $this->assertEquals($signal_list[$signal_name_1][
'js_code'], $custom_code_1);
115 $this->assertEquals($signal_list[$signal_name_2][
'js_code'], $custom_code_2);
test_implements_factory_interface()
test_create_with_custom_signal()
test_get_list_of_signals()
Provides common functionality for UI tests.
test_get_non_existing_custom_signal()
test_get_list_with_custom_signals_and_code()
Test on button implementation.
test_get_existing_custom_signal()
getDefaultRenderer(JavaScriptBinding $js_binding=null, $with_stub_renderings=[])