ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
InitUIFrameworkTest Class Reference
+ Inheritance diagram for InitUIFrameworkTest:
+ Collaboration diagram for InitUIFrameworkTest:

Public Member Functions

 testUIFrameworkInitialization ()
 
 testByExampleThatFactoryIsLoaded ()
 This checks only by example that the factory is loaded and ready to work. More...
 
 testByExampleThatRendererIsReadyToWork ()
 This checks only by example that the renderer is all up and ready to work. More...
 

Protected Member Functions

 setUp ()
 Several dependencies need to be wired up before the UI Framework can be initialised. More...
 

Protected Attributes

 $dic
 

Detailed Description

Definition at line 23 of file InitUIFrameworkTest.php.

Member Function Documentation

◆ setUp()

InitUIFrameworkTest::setUp ( )
protected

Several dependencies need to be wired up before the UI Framework can be initialised.

Definition at line 33 of file InitUIFrameworkTest.php.

33  : void
34  {
35  $this->dic = new \ILIAS\DI\Container();
36 
37  $this->dic["lng"] = $this->createMock("\ilLanguage");
38  $this->dic["tpl"] = $this->createMock("\ilGlobalTemplateInterface");
39  $this->dic["refinery"] = $this->createMock("\ILIAS\Refinery\Factory");
40  $this->dic["help.text_retriever"] = $this->createMock("ILIAS\UI\Help\TextRetriever\Echoing");
41  }

◆ testByExampleThatFactoryIsLoaded()

InitUIFrameworkTest::testByExampleThatFactoryIsLoaded ( )

This checks only by example that the factory is loaded and ready to work.

A complete check of the factory is performed in the Test cases of tests/UI

Definition at line 59 of file InitUIFrameworkTest.php.

References init().

59  : void
60  {
61  (new \InitUIFramework())->init($this->dic);
62 
63  $this->assertInstanceOf(
64  "ILIAS\UI\Implementation\Component\Divider\Vertical",
65  $this->dic->ui()->factory()->divider()->vertical()
66  );
67  }
+ Here is the call graph for this function:

◆ testByExampleThatRendererIsReadyToWork()

InitUIFrameworkTest::testByExampleThatRendererIsReadyToWork ( )

This checks only by example that the renderer is all up and ready to work.

A complete set of the rendering tests is performed in the Test cases of tests/UI Note that some additional dependencies are needed for this to run.

Definition at line 74 of file InitUIFrameworkTest.php.

References $DIC, and init().

74  : void
75  {
76  (new \InitUIFramework())->init($this->dic);
77  $this->dic["tpl"]->expects($this->atLeastOnce())->method("addJavaScript");
78 
79  //Note, this dep is not properly injected ilTemplate, therefore we need to hit on the global.
80  global $DIC;
81  $initial_state = $DIC;
82  $DIC = new \ILIAS\DI\Container();
83  $DIC["component.factory"] = $this->createMock(ilComponentFactory::class);
84 
85  $example_componanent = $this->dic->ui()->factory()->divider()->vertical();
86  $example_out = $this->dic->ui()->renderer()->render($example_componanent);
87  $this->assertIsString($example_out);
88  $DIC = $initial_state;
89  }
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

◆ testUIFrameworkInitialization()

InitUIFrameworkTest::testUIFrameworkInitialization ( )

Definition at line 43 of file InitUIFrameworkTest.php.

References init().

43  : void
44  {
45  $this->assertInstanceOf("\ILIAS\DI\UIServices", $this->dic->ui());
46  $this->assertFalse(isset($this->dic['ui.factory']));
47  $this->assertFalse(isset($this->dic['ui.renderer']));
48  (new \InitUIFramework())->init($this->dic);
49  $this->assertTrue(isset($this->dic['ui.factory']));
50  $this->assertTrue(isset($this->dic['ui.renderer']));
51  $this->assertInstanceOf("\ILIAS\UI\Factory", $this->dic->ui()->factory());
52  $this->assertInstanceOf("\ILIAS\UI\Renderer", $this->dic->ui()->renderer());
53  }
+ Here is the call graph for this function:

Field Documentation

◆ $dic

InitUIFrameworkTest::$dic
protected

Definition at line 28 of file InitUIFrameworkTest.php.


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