ILIAS  release_8 Revision v8.24
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 13 of file ilSystemCheckTaskTest.php.

Member Function Documentation

◆ initDependencies()

ilSystemCheckTaskTest::initDependencies ( )
protected

Definition at line 51 of file ilSystemCheckTaskTest.php.

51 : void
52 {
53 $this->dic = new Container();
54 $GLOBALS['DIC'] = $this->dic;
55 $this->setGlobalVariable(
56 'ilDB',
57 $this->createMock(ilDBInterface::class)
58 );
59 $logger = $this->getMockBuilder(ilLogger::class)
60 ->disableOriginalConstructor()
61 ->getMock();
62
63 $logger_factory = $this->getMockBuilder(ilLoggerFactory::class)
64 ->disableOriginalConstructor()
65 ->onlyMethods(['getComponentLogger'])
66 ->getMock();
67 $logger_factory->method('getComponentLogger')->willReturn($logger);
68 $this->setGlobalVariable('ilLoggerFactory', $logger_factory);
69 }
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()

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

Definition at line 40 of file ilSystemCheckTaskTest.php.

40 : void
41 {
42 global $DIC;
43
44 $GLOBALS[$name] = $value;
45 unset($DIC[$name]);
46 $DIC[$name] = static function (Container $c) use ($value) {
47 return $value;
48 };
49 }
$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()

ilSystemCheckTaskTest::setUp ( )
protected

Definition at line 17 of file ilSystemCheckTaskTest.php.

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

References initDependencies().

+ Here is the call graph for this function:

◆ testConstruct()

ilSystemCheckTaskTest::testConstruct ( )

Definition at line 23 of file ilSystemCheckTaskTest.php.

23 : void
24 {
25 $task = new ilSCTask(0);
26 $this->assertInstanceOf(ilSCTask::class, $task);
27 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ testLastUpdate()

ilSystemCheckTaskTest::testLastUpdate ( )

Definition at line 29 of file ilSystemCheckTaskTest.php.

29 : void
30 {
31 $this->getMockBuilder(ilDateTime::class)
32 ->disableOriginalConstructor()
33 ->getMock();
34
35 $task = new ilSCTask();
36 $last_update = $task->getLastUpdate();
37 $this->assertInstanceOf(ilDateTime::class, $last_update);
38 }

Field Documentation

◆ $dic

Container ilSystemCheckTaskTest::$dic
protected

Definition at line 15 of file ilSystemCheckTaskTest.php.

Referenced by initDependencies().


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