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

Unit tests for class ilDidacticTemplate. More...

+ Inheritance diagram for ilLogComponentLevelTest:
+ Collaboration diagram for ilLogComponentLevelTest:

Public Member Functions

 testLevel ()
 

Protected Member Functions

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

Protected Attributes

Container $dic
 

Detailed Description

Unit tests for class ilDidacticTemplate.

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

Definition at line 29 of file ilLogComponentLevelTest.php.

Member Function Documentation

◆ initDependencies()

ilLogComponentLevelTest::initDependencies ( )
protected

Definition at line 61 of file ilLogComponentLevelTest.php.

61 : void
62 {
63 $this->dic = new Container();
64 $GLOBALS['DIC'] = $this->dic;
65 $this->setGlobalVariable('ilDB', $this->createMock(ilDBInterface::class));
66 }
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()

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

Definition at line 50 of file ilLogComponentLevelTest.php.

50 : void
51 {
52 global $DIC;
53
54 $GLOBALS[$name] = $value;
55 unset($DIC[$name]);
56 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
57 return $value;
58 };
59 }
$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()

ilLogComponentLevelTest::setUp ( )
protected

Definition at line 33 of file ilLogComponentLevelTest.php.

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

References initDependencies().

+ Here is the call graph for this function:

◆ testLevel()

ilLogComponentLevelTest::testLevel ( )

Definition at line 39 of file ilLogComponentLevelTest.php.

39 : void
40 {
41 $component_level = new ilLogComponentLevel(
42 'log',
44 );
45 $this->assertEquals('log', $component_level->getComponentId());
46 $this->assertEquals(ilLogLevel::CRITICAL, $component_level->getLevel());
47 }
individual log levels for components

References ilLogLevel\CRITICAL.

Field Documentation

◆ $dic

Container ilLogComponentLevelTest::$dic
protected

Definition at line 31 of file ilLogComponentLevelTest.php.

Referenced by initDependencies().


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