ILIAS  release_8 Revision v8.24
ilTrackingCollectionTest Class Reference
+ Inheritance diagram for ilTrackingCollectionTest:
+ Collaboration diagram for ilTrackingCollectionTest:

Public Member Functions

 testCollectionInstance ()
 

Protected Member Functions

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

Protected Attributes

Container $dic
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.d.nosp@m.e

Definition at line 12 of file ilTrackingCollectionTest.php.

Member Function Documentation

◆ initDependencies()

ilTrackingCollectionTest::initDependencies ( )
protected

Definition at line 45 of file ilTrackingCollectionTest.php.

45 : void
46 {
47 $this->dic = new Container();
48 $GLOBALS['DIC'] = $this->dic;
49 $this->setGlobalVariable(
50 'ilDB',
51 $this->createMock(ilDBInterface::class)
52 );
53 $logger = $this->getMockBuilder(ilLogger::class)
54 ->disableOriginalConstructor()
55 ->getMock();
56
57 $logger_factory = $this->getMockBuilder(ilLoggerFactory::class)
58 ->disableOriginalConstructor()
59 ->onlyMethods(['getComponentLogger'])
60 ->getMock();
61 $logger_factory->method('getComponentLogger')->willReturn($logger);
62 $this->setGlobalVariable('ilLoggerFactory', $logger_factory);
63 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
setGlobalVariable(string $name, $value)

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()

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

Definition at line 34 of file ilTrackingCollectionTest.php.

34 : void
35 {
36 global $DIC;
37
38 $GLOBALS[$name] = $value;
39 unset($DIC[$name]);
40 $DIC[$name] = static function (Container $c) use ($value) {
41 return $value;
42 };
43 }
$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.

Referenced by initDependencies().

+ Here is the caller graph for this function:

◆ setUp()

ilTrackingCollectionTest::setUp ( )
protected

Definition at line 16 of file ilTrackingCollectionTest.php.

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

References initDependencies().

+ Here is the call graph for this function:

◆ testCollectionInstance()

ilTrackingCollectionTest::testCollectionInstance ( )

Definition at line 22 of file ilTrackingCollectionTest.php.

22 : void
23 {
25 0,
27 );
28 $this->assertInstanceOf(
29 ilLPCollectionOfObjectives::class,
31 );
32 }
static getInstanceByMode(int $a_obj_id, int $a_mode)
$objectives

References $objectives, ilLPCollection\getInstanceByMode(), and ilLPObjSettings\LP_MODE_OBJECTIVES.

+ Here is the call graph for this function:

Field Documentation

◆ $dic

Container ilTrackingCollectionTest::$dic
protected

Definition at line 14 of file ilTrackingCollectionTest.php.

Referenced by initDependencies().


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