ILIAS  release_8 Revision v8.24
SystemStylesGlobalScreenToolProviderTest Class Reference
+ Inheritance diagram for SystemStylesGlobalScreenToolProviderTest:
+ Collaboration diagram for SystemStylesGlobalScreenToolProviderTest:

Public Member Functions

 testConstruct ()
 
 testIsInterestedInContexts ()
 
 testBuildTreeAsToolNotInContext ()
 
 testBuildTreeAsToolIfInAdminstrationContext ()
 
 testBuildTreeAsToolIfInAdminstrationContextAndTreeIsAvailable ()
 

Protected Member Functions

 setUp ()
 

Protected Attributes

UITestHelper $ui_helper
 
array $entries_data
 
Entries $entries
 
Entry $entry
 
array $entry_data
 
URI $test_uri
 
SystemStylesGlobalScreenToolProvider $tool_provider
 
Container $dic
 

Detailed Description

Definition at line 36 of file SystemStylesGlobalScreenToolProviderTest.php.

Member Function Documentation

◆ setUp()

SystemStylesGlobalScreenToolProviderTest::setUp ( )
protected

Definition at line 47 of file SystemStylesGlobalScreenToolProviderTest.php.

47 : void
48 {
49 global $DIC;
50
51 $this->dic = new Container();
52 $this->dic = (new UITestHelper())->init($this->dic);
53
54 $this->dic['ilCtrl'] = $this->getMockBuilder(ilCtrl::class)->disableOriginalConstructor()->onlyMethods([
55 'getLinkTargetByClass'
56 ])->getMock();
57 $this->dic['ilCtrl']->method('getLinkTargetByClass')->willReturn('1');
58
59 (new InitHttpServices())->init($this->dic);
60
61 $this->dic['global_screen'] = $this
62 ->getMockBuilder(ILIAS\GlobalScreen\Services::class)
63 ->disableOriginalConstructor()
64 ->onlyMethods(['identification'])
65 ->getMock();
66 $provider_factory = $this->getMockBuilder(ProviderFactory::class)->getMock();
67 $identification = new IdentificationFactory($provider_factory);
68 $this->dic['global_screen']->method('identification')->willReturn($identification);
69
71 $this->tool_provider = new SystemStylesGlobalScreenToolProvider($this->dic);
72
73 if (!defined('ILIAS_HTTP_PATH')) {
74 define('ILIAS_HTTP_PATH', 'http://localhost');
75 }
76 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
Class IdentificationFactory All elements in the GlobalScreen service must be identifiable for the sup...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Provider for the Tree in the Main Bar Slate showing the UI Components.
Class UITestHelper can be helpful for test cases outside the UI Components, to inject a working facto...
global $DIC
Definition: feed.php:28
Class ChatMainBarProvider \MainMenu\Provider.

References $DIC, and $dic.

◆ testBuildTreeAsToolIfInAdminstrationContext()

SystemStylesGlobalScreenToolProviderTest::testBuildTreeAsToolIfInAdminstrationContext ( )

Definition at line 97 of file SystemStylesGlobalScreenToolProviderTest.php.

97 : void
98 {
99 $contexts = (new CalledContexts(new ContextRepository()))->administration();
100 $this->assertEquals([], $this->tool_provider->getToolsForContextStack($contexts));
101 }
Class ContextRepository The Collection of all available Contexts in the System.

◆ testBuildTreeAsToolIfInAdminstrationContextAndTreeIsAvailable()

SystemStylesGlobalScreenToolProviderTest::testBuildTreeAsToolIfInAdminstrationContextAndTreeIsAvailable ( )

Definition at line 103 of file SystemStylesGlobalScreenToolProviderTest.php.

103 : void
104 {
105 $tree_available_context = (new ILIAS\GlobalScreen\ScreenContext\BasicScreenContext('administration'))->addAdditionalData(ilSystemStyleDocumentationGUI::SHOW_TREE, true);
106 $contexts = new CalledContexts(new ContextRepository());
107 $contexts->push($tree_available_context);
108 $tools = $this->tool_provider->getToolsForContextStack($contexts);
109 $this->assertCount(1, $tools);
110 $tool = array_pop($tools);
111 $this->assertInstanceOf(Tool::class, $tool);
112 $this->assertEquals('documentation', $tool->getTitle());
113 }

References ilSystemStyleDocumentationGUI\SHOW_TREE.

◆ testBuildTreeAsToolNotInContext()

SystemStylesGlobalScreenToolProviderTest::testBuildTreeAsToolNotInContext ( )

Definition at line 91 of file SystemStylesGlobalScreenToolProviderTest.php.

91 : void
92 {
93 $contexts = new CalledContexts(new ContextRepository());
94 $this->assertEquals([], $this->tool_provider->getToolsForContextStack($contexts));
95 }

◆ testConstruct()

SystemStylesGlobalScreenToolProviderTest::testConstruct ( )

Definition at line 78 of file SystemStylesGlobalScreenToolProviderTest.php.

78 : void
79 {
80 $this->assertInstanceOf('SystemStylesGlobalScreenToolProvider', $this->tool_provider);
81 }

◆ testIsInterestedInContexts()

SystemStylesGlobalScreenToolProviderTest::testIsInterestedInContexts ( )

Definition at line 83 of file SystemStylesGlobalScreenToolProviderTest.php.

83 : void
84 {
85 $this->assertEquals(
86 ['administration'],
87 $this->tool_provider->isInterestedInContexts()->getStackAsArray()
88 );
89 }

Field Documentation

◆ $dic

Container SystemStylesGlobalScreenToolProviderTest::$dic
protected

Definition at line 45 of file SystemStylesGlobalScreenToolProviderTest.php.

Referenced by setUp().

◆ $entries

Entries SystemStylesGlobalScreenToolProviderTest::$entries
protected

Definition at line 40 of file SystemStylesGlobalScreenToolProviderTest.php.

◆ $entries_data

array SystemStylesGlobalScreenToolProviderTest::$entries_data
protected

Definition at line 39 of file SystemStylesGlobalScreenToolProviderTest.php.

◆ $entry

Entry SystemStylesGlobalScreenToolProviderTest::$entry
protected

Definition at line 41 of file SystemStylesGlobalScreenToolProviderTest.php.

◆ $entry_data

array SystemStylesGlobalScreenToolProviderTest::$entry_data
protected

Definition at line 42 of file SystemStylesGlobalScreenToolProviderTest.php.

◆ $test_uri

URI SystemStylesGlobalScreenToolProviderTest::$test_uri
protected

Definition at line 43 of file SystemStylesGlobalScreenToolProviderTest.php.

◆ $tool_provider

SystemStylesGlobalScreenToolProvider SystemStylesGlobalScreenToolProviderTest::$tool_provider
protected

Definition at line 44 of file SystemStylesGlobalScreenToolProviderTest.php.

◆ $ui_helper

UITestHelper SystemStylesGlobalScreenToolProviderTest::$ui_helper
protected

Definition at line 38 of file SystemStylesGlobalScreenToolProviderTest.php.


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