ILIAS  release_8 Revision v8.24
ilADTFactoryTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5use PHPUnit\Framework\TestCase;
7
12class ilADTFactoryTest extends TestCase
13{
14 protected $backupGlobals = false;
15
16 protected Container $dic;
17
18 protected function setUp(): void
19 {
20 $this->initDependencies();
21 parent::setUp();
22 }
23
24 public function testConstruct(): void
25 {
27 $second = ilADTFactory::getInstance();
28 $this->assertEquals($first, $second);
29 }
30
31 protected function setGlobalVariable(string $name, $value): void
32 {
33 global $DIC;
34
35 $GLOBALS[$name] = $value;
36 unset($DIC[$name]);
37 $DIC[$name] = static function (\ILIAS\DI\Container $c) use ($value) {
38 return $value;
39 };
40 }
41
42 protected function initDependencies(): void
43 {
44 $this->dic = new Container();
45 $GLOBALS['DIC'] = $this->dic;
46 }
47}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
Unit tests for class ilADTFactory.
setGlobalVariable(string $name, $value)
$c
Definition: cli.php:38
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247