ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMDTest Class Reference

Unit tests for tree table. More...

+ Inheritance diagram for ilMDTest:
+ Collaboration diagram for ilMDTest:

Public Member Functions

 testMDConstruct ()
 

Protected Member Functions

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

Protected Attributes

Container $dic
 

Detailed Description

Unit tests for tree table.

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

Definition at line 37 of file ilMDTest.php.

Member Function Documentation

◆ initDependencies()

ilMDTest::initDependencies ( )
protected

Definition at line 64 of file ilMDTest.php.

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

Referenced by setUp().

64  : void
65  {
66  $this->dic = new Container();
67  $GLOBALS['DIC'] = $this->dic;
68 
69  $this->setGlobalVariable('ilDB', $this->createMock(ilDBInterface::class));
70 
71  $logger = $this->getMockBuilder(ilLogger::class)
72  ->disableOriginalConstructor()
73  ->getMock();
74 
75  $logger_factory = $this->getMockBuilder(ilLoggerFactory::class)
76  ->disableOriginalConstructor()
77  ->onlyMethods(['getComponentLogger'])
78  ->getMock();
79  $logger_factory->method('getComponentLogger')->willReturn($logger);
80  $this->setGlobalVariable('ilLoggerFactory', $logger_factory);
81  }
Container $dic
Definition: ilMDTest.php:39
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:31
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
setGlobalVariable(string $name, $value)
Definition: ilMDTest.php:53
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setGlobalVariable()

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

Definition at line 53 of file ilMDTest.php.

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

Referenced by initDependencies().

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

ilMDTest::setUp ( )
protected

Definition at line 41 of file ilMDTest.php.

References initDependencies().

41  : void
42  {
43  $this->initDependencies();
44  parent::setUp();
45  }
initDependencies()
Definition: ilMDTest.php:64
+ Here is the call graph for this function:

◆ testMDConstruct()

ilMDTest::testMDConstruct ( )

Definition at line 47 of file ilMDTest.php.

47  : void
48  {
49  $md = new ilMD();
50  $this->assertInstanceOf(ilMD::class, $md);
51  }

Field Documentation

◆ $dic

Container ilMDTest::$dic
protected

Definition at line 39 of file ilMDTest.php.

Referenced by initDependencies().


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