ILIAS  trunk Revision v11.0_alpha-1753-gb21ca8c4367
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

References $dic, $GLOBALS, and setGlobalVariable().

Referenced by setUp().

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  }
setGlobalVariable(string $name, $value)
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
$GLOBALS["DIC"]
Definition: wac.php:53
+ 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.

References $c, $DIC, and $GLOBALS.

Referenced by initDependencies().

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
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
$GLOBALS["DIC"]
Definition: wac.php:53
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ setUp()

ilSystemCheckTaskTest::setUp ( )
protected

Definition at line 33 of file ilSystemCheckTaskTest.php.

References initDependencies().

33  : void
34  {
35  parent::setUp();
36  $this->initDependencies();
37  }
+ 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  }
Defines a system check task.

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: