ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilADTFactoryTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use PHPUnit\Framework\TestCase;
23
28class ilADTFactoryTest extends TestCase
29{
30 protected $backupGlobals = false;
31
32 protected Container $dic;
33
34 protected function setUp(): void
35 {
36 $this->initDependencies();
37 parent::setUp();
38 }
39
40 public function testConstruct(): void
41 {
43 $second = ilADTFactory::getInstance();
44 $this->assertEquals($first, $second);
45 }
46
47 protected function setGlobalVariable(string $name, $value): void
48 {
49 global $DIC;
50
51 $GLOBALS[$name] = $value;
52 unset($DIC[$name]);
53 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
54 return $value;
55 };
56 }
57
58 protected function initDependencies(): void
59 {
60 $this->dic = new Container();
61 $GLOBALS['DIC'] = $this->dic;
62 }
63}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
Unit tests for class ilADTFactory.
setGlobalVariable(string $name, $value)
$c
Definition: deliver.php:25
global $DIC
Definition: shib_login.php:26
$GLOBALS["DIC"]
Definition: wac.php:54