ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilRBACTest Class Reference

Unit tests for tree table. More...

+ Inheritance diagram for ilRBACTest:
+ Collaboration diagram for ilRBACTest:

Public Member Functions

 testConstruct ()
 

Protected Member Functions

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

Protected Attributes

 $backupGlobals = false
 
Container $dic
 

Detailed Description

Unit tests for tree table.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 29 of file ilRBACTest.php.

Member Function Documentation

◆ initACDependencies()

ilRBACTest::initACDependencies ( )
protected

Definition at line 64 of file ilRBACTest.php.

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

Referenced by setUp().

64  : void
65  {
66  $this->dic = new Container();
67  $GLOBALS['DIC'] = $this->dic;
68 
69  $this->setGlobalVariable('ilDB', $this->createMock(ilDBInterface::class));
70  $this->setGlobalVariable('ilUser', $this->createMock(ilObjUser::class));
71  $this->setGlobalVariable('rbacreview', $this->createMock(ilRbacReview::class));
72  $this->setGlobalVariable('ilObjDataCache', $this->createMock(ilObjectDataCache::class));
73  $this->setGlobalVariable('tree', $this->createMock(ilTree::class));
74  $this->setGlobalVariable('http', $this->createMock(\ILIAS\HTTP\Services::class));
75  $this->setGlobalVariable('refinery', $this->createMock(\ILIAS\Refinery\Factory::class));
76 
77  $logger = $this->getMockBuilder(ilLogger::class)
78  ->disableOriginalConstructor()
79  ->getMock();
80 
81  $logger_factory = $this->getMockBuilder(ilLoggerFactory::class)
82  ->disableOriginalConstructor()
83  ->onlyMethods(['getComponentLogger'])
84  ->getMock();
85  $logger_factory->method('getComponentLogger')->willReturn($logger);
86  $this->setGlobalVariable('ilLoggerFactory', $logger_factory);
87 
88  if (!defined('ILIAS_LOG_ENABLED')) {
89  define('ILIAS_LOG_ENABLED', true);
90  }
91 
92  if (!defined('ILIAS_LOG_DIR')) {
93  define('ILIAS_LOG_DIR', '/var/log');
94  }
95  }
Interface Observer Contains several chained tasks and infos about them.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
$GLOBALS["DIC"]
Definition: wac.php:53
setGlobalVariable(string $name, $value)
Definition: ilRBACTest.php:53
Container $dic
Definition: ilRBACTest.php:33
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setGlobalVariable()

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

Definition at line 53 of file ilRBACTest.php.

References $c, $DIC, and $GLOBALS.

Referenced by initACDependencies().

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

ilRBACTest::setUp ( )
protected

Definition at line 35 of file ilRBACTest.php.

References initACDependencies().

35  : void
36  {
37  $this->initACDependencies();
38  parent::setUp();
39  }
initACDependencies()
Definition: ilRBACTest.php:64
+ Here is the call graph for this function:

◆ testConstruct()

ilRBACTest::testConstruct ( )

Definition at line 41 of file ilRBACTest.php.

References ilRbacSystem\getInstance().

41  : void
42  {
43  $system = ilRbacSystem::getInstance();
44  $this->assertTrue($system instanceof ilRbacSystem);
45 
46  $admin = new ilRbacAdmin();
47  $this->assertTrue($admin instanceof ilRbacAdmin);
48 
49  $review = new ilRbacReview();
50  $this->assertTrue($review instanceof ilRbacReview);
51  }
Class ilRbacAdmin Core functions for role based access control.
+ Here is the call graph for this function:

Field Documentation

◆ $backupGlobals

ilRBACTest::$backupGlobals = false
protected

Definition at line 31 of file ilRBACTest.php.

◆ $dic

Container ilRBACTest::$dic
protected

Definition at line 33 of file ilRBACTest.php.

Referenced by initACDependencies().


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