ILIAS
release_8 Revision v8.23
◀ ilDoc Overview
ilADTFactoryTest.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
5
use
PHPUnit\Framework\TestCase
;
6
use
ILIAS\DI\Container
;
7
12
class
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
{
26
$first =
ilADTFactory::getInstance
();
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
}
ilADTFactoryTest\testConstruct
testConstruct()
Definition:
ilADTFactoryTest.php:24
$c
$c
Definition:
cli.php:38
ilADTFactoryTest\initDependencies
initDependencies()
Definition:
ilADTFactoryTest.php:42
ilADTFactoryTest\$dic
Container $dic
Definition:
ilADTFactoryTest.php:16
ilADTFactory\getInstance
static getInstance()
Definition:
class.ilADTFactory.php:14
ILIAS\DI\Container
Customizing of pimple-DIC for ILIAS.
Definition:
Container.php:31
ilADTFactoryTest\setGlobalVariable
setGlobalVariable(string $name, $value)
Definition:
ilADTFactoryTest.php:31
$DIC
global $DIC
Definition:
feed.php:28
Container
$name
if($format !==null) $name
Definition:
metadata.php:247
ilADTFactoryTest\setUp
setUp()
Definition:
ilADTFactoryTest.php:18
$GLOBALS
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition:
PEAR.php:64
ilADTFactoryTest\$backupGlobals
$backupGlobals
Definition:
ilADTFactoryTest.php:14
ilADTFactoryTest
Unit tests for class ilADTFactory.
Definition:
ilADTFactoryTest.php:12
TestCase
Services
ADT
test
ilADTFactoryTest.php
Generated on Sun Aug 31 2025 22:01:44 for ILIAS by
1.8.13 (using
Doxyfile
)