ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

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
96 if (!defined('ILIAS_LOG_FILE')) {
97 define('ILIAS_LOG_FILE', '/var/log/ilias.log');
98 }
99 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
Container $dic
Definition: ilRBACTest.php:33
setGlobalVariable(string $name, $value)
Definition: ilRBACTest.php:53
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
$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()

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

Definition at line 53 of file ilRBACTest.php.

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
global $DIC
Definition: shib_login.php:26

References $c, $DIC, and $GLOBALS.

Referenced by initACDependencies().

+ Here is the caller graph for this function:

◆ setUp()

ilRBACTest::setUp ( )
protected

Definition at line 35 of file ilRBACTest.php.

35 : void
36 {
37 $this->initACDependencies();
38 parent::setUp();
39 }
initACDependencies()
Definition: ilRBACTest.php:64

References initACDependencies().

+ Here is the call graph for this function:

◆ testConstruct()

ilRBACTest::testConstruct ( )

Definition at line 41 of file ilRBACTest.php.

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.
class ilRbacReview Contains Review functions of core Rbac.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...

References ilRbacSystem\getInstance().

+ 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: