3 declare(strict_types=1);
12 protected function setUp(): void
16 if (!defined(
"ROOT_FOLDER_ID")) {
17 define(
"ROOT_FOLDER_ID", 8);
19 if (!defined(
"ILIAS_LOG_ENABLED")) {
20 define(
"ILIAS_LOG_ENABLED",
false);
22 if (!defined(
"ILIAS_LOG_DIR")) {
23 define(
"ILIAS_LOG_DIR",
'/var/log');
25 if (!defined(
"ILIAS_LOG_FILE")) {
26 define(
"ILIAS_LOG_FILE",
'/var/log/ilias.log');
33 $this->assertTrue($tree instanceof
ilTree);
40 $tree->initLangCode();
41 $tree_reflection =
new ReflectionProperty($tree,
'lang_code');
42 $tree_reflection->setAccessible(
true);
43 $this->assertEquals(
'en', $tree_reflection->getValue($tree));
48 $user = $this->getMockBuilder(ilObjUser::class)
49 ->disableOriginalConstructor()
50 ->onlyMethods([
'getCurrentLanguage'])
52 $user->method(
'getCurrentLanguage')->willReturn(
'');
54 $tree->initLangCode();
55 $tree_reflection =
new ReflectionProperty($tree,
'lang_code');
56 $tree_reflection->setAccessible(
true);
57 $this->assertEquals(
'en', $tree_reflection->getValue($tree));
81 $this->
setGlobalVariable(
'ilAppEventHandler', $this->createMock(ilAppEventHandler::class));
83 $logger = $this->getMockBuilder(ilLogger::class)
84 ->disableOriginalConstructor()
87 $logger_factory = $this->getMockBuilder(ilLoggerFactory::class)
88 ->disableOriginalConstructor()
89 ->onlyMethods([
'getComponentLogger'])
91 $logger_factory->method(
'getComponentLogger')->willReturn($logger);
Customizing of pimple-DIC for ILIAS.
setGlobalVariable(string $name, $value)
initRepositoryTreeDependencies()