ILIAS  release_8 Revision v8.24
ilADTFactoryTest Class Reference

Unit tests for class ilADTFactory. More...

+ Inheritance diagram for ilADTFactoryTest:
+ Collaboration diagram for ilADTFactoryTest:

Public Member Functions

 testConstruct ()
 

Protected Member Functions

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

Protected Attributes

 $backupGlobals = false
 
Container $dic
 

Detailed Description

Unit tests for class ilADTFactory.

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

Definition at line 12 of file ilADTFactoryTest.php.

Member Function Documentation

◆ initDependencies()

ilADTFactoryTest::initDependencies ( )
protected

Definition at line 42 of file ilADTFactoryTest.php.

42 : void
43 {
44 $this->dic = new Container();
45 $GLOBALS['DIC'] = $this->dic;
46 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32

References $dic, and $GLOBALS.

Referenced by setUp().

+ Here is the caller graph for this function:

◆ setGlobalVariable()

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

Definition at line 31 of file ilADTFactoryTest.php.

31 : void
32 {
33 global $DIC;
34
35 $GLOBALS[$name] = $value;
36 unset($DIC[$name]);
37 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
38 return $value;
39 };
40 }
$c
Definition: cli.php:38
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247

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

◆ setUp()

ilADTFactoryTest::setUp ( )
protected

Definition at line 18 of file ilADTFactoryTest.php.

18 : void
19 {
20 $this->initDependencies();
21 parent::setUp();
22 }

References initDependencies().

+ Here is the call graph for this function:

◆ testConstruct()

ilADTFactoryTest::testConstruct ( )

Definition at line 24 of file ilADTFactoryTest.php.

24 : void
25 {
27 $second = ilADTFactory::getInstance();
28 $this->assertEquals($first, $second);
29 }

References ilADTFactory\getInstance().

+ Here is the call graph for this function:

Field Documentation

◆ $backupGlobals

ilADTFactoryTest::$backupGlobals = false
protected

Definition at line 14 of file ilADTFactoryTest.php.

◆ $dic

Container ilADTFactoryTest::$dic
protected

Definition at line 16 of file ilADTFactoryTest.php.

Referenced by initDependencies().


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