ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilGroupEventHandlerTest Class Reference

Unit tests for tree table. More...

+ Inheritance diagram for ilGroupEventHandlerTest:
+ Collaboration diagram for ilGroupEventHandlerTest:

Public Member Functions

 testConstruct ()
 

Protected Member Functions

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

Protected Attributes

 $backupGlobals = false
 
Container $dic
 

Detailed Description

Unit tests for tree table.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 29 of file ilGroupEventHandlerTest.php.

Member Function Documentation

◆ initDependencies()

ilGroupEventHandlerTest::initDependencies ( )
protected

Definition at line 58 of file ilGroupEventHandlerTest.php.

58 : void
59 {
60 $this->dic = new Container();
61 $GLOBALS['DIC'] = $this->dic;
62
63 $logger = $this->getMockBuilder(ilLogger::class)
64 ->disableOriginalConstructor()
65 ->getMock();
66
67 $logger_factory = $this->getMockBuilder(ilLoggerFactory::class)
68 ->disableOriginalConstructor()
69 ->onlyMethods(['getComponentLogger'])
70 ->getMock();
71 $logger_factory->method('getComponentLogger')->willReturn($logger);
72 $this->setGlobalVariable('ilLoggerFactory', $logger_factory);
73 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
setGlobalVariable(string $name, $value)
$GLOBALS["DIC"]
Definition: wac.php:54

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

Referenced by setUp().

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

◆ setGlobalVariable()

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

Definition at line 47 of file ilGroupEventHandlerTest.php.

47 : void
48 {
49 global $DIC;
50
51 $GLOBALS[$name] = $value;
52 unset($DIC[$name]);
53 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
54 return $value;
55 };
56 }
$c
Definition: deliver.php:25
global $DIC
Definition: shib_login.php:26

References $c, $DIC, and $GLOBALS.

Referenced by initDependencies().

+ Here is the caller graph for this function:

◆ setUp()

ilGroupEventHandlerTest::setUp ( )
protected

Definition at line 35 of file ilGroupEventHandlerTest.php.

35 : void
36 {
37 $this->initDependencies();
38 parent::setUp();
39 }

References initDependencies().

+ Here is the call graph for this function:

◆ testConstruct()

ilGroupEventHandlerTest::testConstruct ( )

Definition at line 41 of file ilGroupEventHandlerTest.php.

41 : void
42 {
43 $listener = new ilGroupAppEventListener();
44 $this->assertTrue($listener instanceof ilGroupAppEventListener);
45 }

Field Documentation

◆ $backupGlobals

ilGroupEventHandlerTest::$backupGlobals = false
protected

Definition at line 31 of file ilGroupEventHandlerTest.php.

◆ $dic

Container ilGroupEventHandlerTest::$dic
protected

Definition at line 33 of file ilGroupEventHandlerTest.php.

Referenced by initDependencies().


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