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

Unit tests for class ilDidacticTemplate. More...

+ Inheritance diagram for ilSystemCheckTaskTest:
+ Collaboration diagram for ilSystemCheckTaskTest:

Public Member Functions

 testConstruct ()
 
 testLastUpdate ()
 

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.d.nosp@m.e

Definition at line 29 of file ilSystemCheckTaskTest.php.

Member Function Documentation

◆ initDependencies()

ilSystemCheckTaskTest::initDependencies ( )
protected

Definition at line 67 of file ilSystemCheckTaskTest.php.

67 : void
68 {
69 $this->dic = new Container();
70 $GLOBALS['DIC'] = $this->dic;
71 $this->setGlobalVariable(
72 'ilDB',
73 $this->createMock(ilDBInterface::class)
74 );
75 $logger = $this->getMockBuilder(ilLogger::class)
76 ->disableOriginalConstructor()
77 ->getMock();
78
79 $logger_factory = $this->getMockBuilder(ilLoggerFactory::class)
80 ->disableOriginalConstructor()
81 ->onlyMethods(['getComponentLogger'])
82 ->getMock();
83 $logger_factory->method('getComponentLogger')->willReturn($logger);
84 $this->setGlobalVariable('ilLoggerFactory', $logger_factory);
85 }
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()

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

Definition at line 56 of file ilSystemCheckTaskTest.php.

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

ilSystemCheckTaskTest::setUp ( )
protected

Definition at line 33 of file ilSystemCheckTaskTest.php.

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

References initDependencies().

+ Here is the call graph for this function:

◆ testConstruct()

ilSystemCheckTaskTest::testConstruct ( )

Definition at line 39 of file ilSystemCheckTaskTest.php.

39 : void
40 {
41 $task = new ilSCTask(0);
42 $this->assertInstanceOf(ilSCTask::class, $task);
43 }
Defines a system check task.

◆ testLastUpdate()

ilSystemCheckTaskTest::testLastUpdate ( )

Definition at line 45 of file ilSystemCheckTaskTest.php.

45 : void
46 {
47 $this->getMockBuilder(ilDateTime::class)
48 ->disableOriginalConstructor()
49 ->getMock();
50
51 $task = new ilSCTask();
52 $last_update = $task->getLastUpdate();
53 $this->assertInstanceOf(ilDateTime::class, $last_update);
54 }

Field Documentation

◆ $dic

Container ilSystemCheckTaskTest::$dic
protected

Definition at line 31 of file ilSystemCheckTaskTest.php.

Referenced by initDependencies().


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