19 declare(strict_types=1);
    21 require_once(__DIR__ . 
"/../../../../libs/composer/vendor/autoload.php");
    22 require_once(__DIR__ . 
"/../../Base.php");
    35             public function legacy(
string $content): C\Legacy\Legacy
    37                 return new IC\Legacy\Legacy($content, 
new IC\SignalGenerator());
    46         $this->assertInstanceOf(
"ILIAS\\UI\\Factory", 
$f);
    47         $this->assertInstanceOf(
    48             "ILIAS\\UI\\Component\\Legacy\\Legacy",
    49             $f->legacy(
"Legacy Content")
    56         $g = 
$f->legacy(
"Legacy Content");
    58         $this->assertEquals(
"Legacy Content", $g->getContent());
    67         $g = 
$f->legacy(
"Legacy Content");
    69         $this->assertEquals(
"Legacy Content", 
$r->render($g));
    78         $signal_name = 
'Custom Signal';
    80         $f->legacy(
'')->withCustomSignal($signal_name, 
'');
    86         $signal_name = 
'Custom Signal';
    87         $g = 
$f->legacy(
'')->withCustomSignal($signal_name, 
'');
    89         $this->assertNotNull($g->getCustomSignal($signal_name));
    95         $signal_name = 
'Custom Signal';
    98         $this->expectException(InvalidArgumentException::class);
    99         $this->expectExceptionMessage(
"Signal with name $signal_name is not registered");
   100         $g->getCustomSignal($signal_name);
   106         $signal_name_1 = 
'Custom Signal 1';
   107         $signal_name_2 = 
'Custom Signal 2';
   109         $g = 
$f->legacy(
'')->withCustomSignal($signal_name_1, 
'')->withCustomSignal($signal_name_2, 
'');
   110         $l = $g->getAllCustomSignals();
   112         $this->assertIsArray($l);
   118         $signal_name_1 = 
'Custom Signal 1';
   119         $custom_code_1 = 
'custom_js1();';
   120         $signal_name_2 = 
'Custom Signal 2';
   121         $custom_code_2 = 
'custom_js2();';
   124             ->withCustomSignal($signal_name_1, $custom_code_1)
   125             ->withCustomSignal($signal_name_2, $custom_code_2);
   126         $signal_list = $g->getAllCustomSignals();
   128         $this->assertEquals(2, count($signal_list));
   129         $this->assertEquals($signal_list[$signal_name_1][
'js_code'], $custom_code_1);
   130         $this->assertEquals($signal_list[$signal_name_2][
'js_code'], $custom_code_2);
 
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
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...
 
testCreateWithCustomSignal()
 
testImplementsFactoryInterface()
 
Provides common functionality for UI tests. 
 
testGetNonExistingCustomSignal()
 
Test on button implementation. 
 
testGetListWithCustomSignalsAndCode()
 
testGetExistingCustomSignal()