ILIAS  release_8 Revision v8.23
PermanentLinkGUITest Class Reference
+ Inheritance diagram for PermanentLinkGUITest:
+ Collaboration diagram for PermanentLinkGUITest:

Public Member Functions

 testProperties ()
 

Protected Member Functions

 setGlobalVariable (string $name, $value)
 
 setUp ()
 
 tearDown ()
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file PermanentLinkGUITest.php.

Member Function Documentation

◆ setGlobalVariable()

PermanentLinkGUITest::setGlobalVariable ( string  $name,
  $value 
)
protected

Definition at line 26 of file PermanentLinkGUITest.php.

References $c, $DIC, $GLOBALS, and $name.

Referenced by setUp().

26  : void
27  {
28  global $DIC;
29 
30  $GLOBALS[$name] = $value;
31 
32  unset($DIC[$name]);
33  $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
34  return $value;
35  };
36  }
$c
Definition: cli.php:38
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the caller graph for this function:

◆ setUp()

PermanentLinkGUITest::setUp ( )
protected

Definition at line 38 of file PermanentLinkGUITest.php.

References $dic, $GLOBALS, and setGlobalVariable().

38  : void
39  {
40  $dic = new ILIAS\DI\Container();
41  $GLOBALS['DIC'] = $dic;
42 
43  if (!defined("ILIAS_LOG_ENABLED")) {
44  define("ILIAS_LOG_ENABLED", false);
45  }
46 
47  parent::setUp();
48 
49  $db_mock = $this->createMock(ilDBInterface::class);
50  $db_mock->method("fetchAssoc")
51  ->will(
52  $this->onConsecutiveCalls(
53  [
54  "component" => "Services/EventHandling",
55  "id" => "MyTestComponent"
56  ],
57  null
58  )
59  );
60 
61 
62  $this->setGlobalVariable(
63  "ilDB",
64  $db_mock
65  );
66  $this->setGlobalVariable(
67  "ilSetting",
68  $this->createMock(ilSetting::class)
69  );
70  $component_repository = $this->createMock(ilComponentRepository::class);
71  $this->setGlobalVariable(
72  "component.repository",
73  $component_repository
74  );
75  $component_factory = $this->createMock(ilComponentFactory::class);
76  $this->setGlobalVariable(
77  "component.factory",
78  $component_factory
79  );
80 
81  $languageMock = $this->getMockBuilder(ilLanguage::class)
82  ->disableOriginalConstructor()
83  ->getMock();
84  $this->setGlobalVariable(
85  "lng",
86  $languageMock
87  );
88 
89  $ctrl = $this->getMockBuilder('ilCtrl')->disableOriginalConstructor()->onlyMethods(
90  ['setParameterByClass', 'redirectByClass', 'forwardCommand']
91  )->getMock();
92  $ctrl->method('setParameterByClass');
93  $ctrl->method('redirectByClass');
94 
95  $this->setGlobalVariable('ilCtrl', $ctrl);
96 
97  $objectDataCache = $this
98  ->getMockBuilder(ilObjectDataCache::class)
99  ->disableOriginalConstructor()
100  ->getMock();
101 
102  $this->setGlobalVariable('ilObjDataCache', $objectDataCache);
103  }
setGlobalVariable(string $name, $value)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$dic
Definition: result.php:32
+ Here is the call graph for this function:

◆ tearDown()

PermanentLinkGUITest::tearDown ( )
protected

Definition at line 105 of file PermanentLinkGUITest.php.

105  : void
106  {
107  }

◆ testProperties()

PermanentLinkGUITest::testProperties ( )

Definition at line 109 of file PermanentLinkGUITest.php.

109  : void
110  {
111  $pm = new ilPermanentLinkGUI(
112  "wiki",
113  55
114  );
115  $pm->setAppend("append");
116  $this->assertEquals(
117  "append",
118  $pm->getAppend()
119  );
120  $pm->setId(66);
121  $this->assertEquals(
122  66,
123  $pm->getId()
124  );
125  $pm->setTitle("title");
126  $this->assertEquals(
127  "title",
128  $pm->getTitle()
129  );
130  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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