ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
LegacyTest Class Reference

Test on button implementation. More...

+ Inheritance diagram for LegacyTest:
+ Collaboration diagram for LegacyTest:

Public Member Functions

 getUIFactory ()
 
 testImplementsFactoryInterface ()
 
 testGetContent ()
 
 testRenderContent ()
 
 testCreateWithCustomSignal ()
 
 testGetExistingCustomSignal ()
 
 testGetNonExistingCustomSignal ()
 
 testGetListOfSignals ()
 
 testGetListWithCustomSignalsAndCode ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDataFactory ()
 
 getHelpTextRetriever ()
 
 getUploadLimitResolver ()
 
 getDefaultRenderer (JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
 
 getDecoratedRenderer (Renderer $default)
 
 normalizeHTML (string $html)
 
 assertHTMLEquals (string $expected_html_as_string, string $html_as_string)
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS_UI_TestBase
 brutallyTrimHTML (string $html)
 A more radical version of normalizeHTML. More...
 
 brutallyTrimSignals (string $html)
 A naive replacement of all il_signal-ids with dots to ease comparisons of rendered output. More...
 

Detailed Description

Test on button implementation.

Definition at line 30 of file LegacyTest.php.

Member Function Documentation

◆ getUIFactory()

LegacyTest::getUIFactory ( )

Definition at line 32 of file LegacyTest.php.

References ILIAS\UI\examples\MainControls\Slate\Legacy\legacy().

Referenced by testCreateWithCustomSignal(), testGetContent(), testGetExistingCustomSignal(), testGetListOfSignals(), testGetListWithCustomSignalsAndCode(), testGetNonExistingCustomSignal(), testImplementsFactoryInterface(), and testRenderContent().

32  : NoUIFactory
33  {
34  return new class () extends NoUIFactory {
35  public function legacy(string $content): C\Legacy\Legacy
36  {
37  return new IC\Legacy\Legacy($content, new IC\SignalGenerator());
38  }
39  };
40  }
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testCreateWithCustomSignal()

LegacyTest::testCreateWithCustomSignal ( )

Definition at line 75 of file LegacyTest.php.

References Vendor\Package\$f, and getUIFactory().

75  : void
76  {
77  $f = $this->getUIFactory();
78  $signal_name = 'Custom Signal';
79 
80  $f->legacy('')->withCustomSignal($signal_name, '');
81  }
+ Here is the call graph for this function:

◆ testGetContent()

LegacyTest::testGetContent ( )

Definition at line 53 of file LegacyTest.php.

References Vendor\Package\$f, and getUIFactory().

53  : void
54  {
55  $f = $this->getUIFactory();
56  $g = $f->legacy("Legacy Content");
57 
58  $this->assertEquals("Legacy Content", $g->getContent());
59  }
+ Here is the call graph for this function:

◆ testGetExistingCustomSignal()

LegacyTest::testGetExistingCustomSignal ( )

Definition at line 83 of file LegacyTest.php.

References Vendor\Package\$f, and getUIFactory().

83  : void
84  {
85  $f = $this->getUIFactory();
86  $signal_name = 'Custom Signal';
87  $g = $f->legacy('')->withCustomSignal($signal_name, '');
88 
89  $this->assertNotNull($g->getCustomSignal($signal_name));
90  }
+ Here is the call graph for this function:

◆ testGetListOfSignals()

LegacyTest::testGetListOfSignals ( )

Definition at line 103 of file LegacyTest.php.

References Vendor\Package\$f, and getUIFactory().

103  : void
104  {
105  $f = $this->getUIFactory();
106  $signal_name_1 = 'Custom Signal 1';
107  $signal_name_2 = 'Custom Signal 2';
108 
109  $g = $f->legacy('')->withCustomSignal($signal_name_1, '')->withCustomSignal($signal_name_2, '');
110  $l = $g->getAllCustomSignals();
111 
112  $this->assertIsArray($l);
113  }
+ Here is the call graph for this function:

◆ testGetListWithCustomSignalsAndCode()

LegacyTest::testGetListWithCustomSignalsAndCode ( )

Definition at line 115 of file LegacyTest.php.

References Vendor\Package\$f, and getUIFactory().

115  : void
116  {
117  $f = $this->getUIFactory();
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();';
122 
123  $g = $f->legacy('')
124  ->withCustomSignal($signal_name_1, $custom_code_1)
125  ->withCustomSignal($signal_name_2, $custom_code_2);
126  $signal_list = $g->getAllCustomSignals();
127 
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);
131  }
+ Here is the call graph for this function:

◆ testGetNonExistingCustomSignal()

LegacyTest::testGetNonExistingCustomSignal ( )

Definition at line 92 of file LegacyTest.php.

References Vendor\Package\$f, and getUIFactory().

92  : void
93  {
94  $f = $this->getUIFactory();
95  $signal_name = 'Custom Signal';
96  $g = $f->legacy('');
97 
98  $this->expectException(InvalidArgumentException::class);
99  $this->expectExceptionMessage("Signal with name $signal_name is not registered");
100  $g->getCustomSignal($signal_name);
101  }
+ Here is the call graph for this function:

◆ testImplementsFactoryInterface()

LegacyTest::testImplementsFactoryInterface ( )

Definition at line 42 of file LegacyTest.php.

References Vendor\Package\$f, and getUIFactory().

42  : void
43  {
44  $f = $this->getUIFactory();
45 
46  $this->assertInstanceOf("ILIAS\\UI\\Factory", $f);
47  $this->assertInstanceOf(
48  "ILIAS\\UI\\Component\\Legacy\\Legacy",
49  $f->legacy("Legacy Content")
50  );
51  }
+ Here is the call graph for this function:

◆ testRenderContent()

LegacyTest::testRenderContent ( )

Definition at line 62 of file LegacyTest.php.

References Vendor\Package\$f, $r, ILIAS_UI_TestBase\getDefaultRenderer(), and getUIFactory().

62  : void
63  {
64  $f = $this->getUIFactory();
65  $r = $this->getDefaultRenderer();
66 
67  $g = $f->legacy("Legacy Content");
68 
69  $this->assertEquals("Legacy Content", $r->render($g));
70  }
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
Definition: Base.php:377
$r
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: