ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 26 of file ilTrackingCollectionTest.php.

Member Function Documentation

◆ initDependencies()

ilTrackingCollectionTest::initDependencies ( )
protected

Definition at line 59 of file ilTrackingCollectionTest.php.

59 : void
60 {
61 $this->dic = new Container();
62 $GLOBALS['DIC'] = $this->dic;
63 $this->setGlobalVariable(
64 'ilDB',
65 $this->createMock(ilDBInterface::class)
66 );
67 $logger = $this->getMockBuilder(ilLogger::class)
68 ->disableOriginalConstructor()
69 ->getMock();
70
71 $logger_factory = $this->getMockBuilder(ilLoggerFactory::class)
72 ->disableOriginalConstructor()
73 ->onlyMethods(['getComponentLogger'])
74 ->getMock();
75 $logger_factory->method('getComponentLogger')->willReturn($logger);
76 $this->setGlobalVariable('ilLoggerFactory', $logger_factory);
77 }
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()

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

Definition at line 48 of file ilTrackingCollectionTest.php.

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

ilTrackingCollectionTest::setUp ( )
protected

Definition at line 30 of file ilTrackingCollectionTest.php.

30 : void
31 {
32 parent::setUp();
33 $this->initDependencies();
34 }

References initDependencies().

+ Here is the call graph for this function:

◆ testCollectionInstance()

ilTrackingCollectionTest::testCollectionInstance ( )

Definition at line 36 of file ilTrackingCollectionTest.php.

36 : void
37 {
39 0,
41 );
42 $this->assertInstanceOf(
43 ilLPCollectionOfObjectives::class,
45 );
46 }
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 28 of file ilTrackingCollectionTest.php.

Referenced by initDependencies().


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