ILIAS  release_8 Revision v8.24
LegacyTest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 getUIFactory ()
 
 test_implements_factory_interface ()
 
 test_get_content ()
 
 test_render_content ()
 
 test_create_with_custom_signal ()
 @doesNotPerformAssertions More...
 
 test_get_existing_custom_signal ()
 
 test_get_non_existing_custom_signal ()
 
 test_get_list_of_signals ()
 
 test_get_list_with_custom_signals_and_code ()
 
- Public Member Functions inherited from ILIAS_UI_TestBase
 setUp ()
 
 tearDown ()
 
 getUIFactory ()
 
 getTemplateFactory ()
 
 getResourceRegistry ()
 
 getLanguage ()
 
 getJavaScriptBinding ()
 
 getRefinery ()
 
 getImagePathResolver ()
 
 getDataFactory ()
 
 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Test on button implementation.

Definition at line 30 of file LegacyTest.php.

Member Function Documentation

◆ getUIFactory()

LegacyTest::getUIFactory ( )

Reimplemented from ILIAS_UI_TestBase.

Definition at line 32 of file LegacyTest.php.

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...

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

Referenced by test_create_with_custom_signal(), test_get_content(), test_get_existing_custom_signal(), test_get_list_of_signals(), test_get_list_with_custom_signals_and_code(), test_get_non_existing_custom_signal(), test_implements_factory_interface(), and test_render_content().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test_create_with_custom_signal()

LegacyTest::test_create_with_custom_signal ( )

@doesNotPerformAssertions

Definition at line 75 of file LegacyTest.php.

75 : void
76 {
77 $f = $this->getUIFactory();
78 $signal_name = 'Custom Signal';
79
80 $f->legacy('')->withCustomSignal($signal_name, '');
81 }

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

+ Here is the call graph for this function:

◆ test_get_content()

LegacyTest::test_get_content ( )

Definition at line 53 of file LegacyTest.php.

53 : void
54 {
55 $f = $this->getUIFactory();
56 $g = $f->legacy("Legacy Content");
57
58 $this->assertEquals("Legacy Content", $g->getContent());
59 }

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

+ Here is the call graph for this function:

◆ test_get_existing_custom_signal()

LegacyTest::test_get_existing_custom_signal ( )

Definition at line 83 of file LegacyTest.php.

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 }

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

+ Here is the call graph for this function:

◆ test_get_list_of_signals()

LegacyTest::test_get_list_of_signals ( )

Definition at line 103 of file LegacyTest.php.

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 }

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

+ Here is the call graph for this function:

◆ test_get_list_with_custom_signals_and_code()

LegacyTest::test_get_list_with_custom_signals_and_code ( )

Definition at line 115 of file LegacyTest.php.

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 }

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

+ Here is the call graph for this function:

◆ test_get_non_existing_custom_signal()

LegacyTest::test_get_non_existing_custom_signal ( )

Definition at line 92 of file LegacyTest.php.

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 }

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

+ Here is the call graph for this function:

◆ test_implements_factory_interface()

LegacyTest::test_implements_factory_interface ( )

Definition at line 42 of file LegacyTest.php.

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 }

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

+ Here is the call graph for this function:

◆ test_render_content()

LegacyTest::test_render_content ( )

Definition at line 62 of file LegacyTest.php.

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:355

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

+ Here is the call graph for this function:

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