ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 

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(): IC\Legacy\Factory
36  {
37  return new IC\Legacy\Factory(new IC\SignalGenerator());
38  }
39  };
40  }
legacy()
expected output: > ILIAS shows the rendered Component.
Definition: legacy.php:29
+ 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()->content('')->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()->content("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()->content('')->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()->content('')->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()->content('')
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()->content('');
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\\Content",
49  $f->legacy()->content("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, and getUIFactory().

62  : void
63  {
64  $f = $this->getUIFactory();
65  $r = $this->getDefaultRenderer();
66 
67  $g = $f->legacy()->content("Legacy Content");
68 
69  $this->assertEquals("Legacy Content", $r->render($g));
70  }
$r
+ Here is the call graph for this function:

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