ILIAS
release_9 Revision v9.13-25-g2c18ec4c24f
◀ ilDoc Overview
ilECSUserTest.php
Go to the documentation of this file.
1
<?php
2
18
declare(strict_types=1);
19
20
use
ILIAS\DI\Container
;
21
use
ILIAS\UI\Component\Legacy\Legacy
;
22
use
ILIAS\UI\Factory
;
23
use
PHPUnit\Framework\MockObject\MockObject
;
24
use
PHPUnit\Framework\TestCase
;
25
29
class
ilECSUserTest
extends
TestCase
30
{
31
protected
function
setUp
(): void
32
{
33
$this->dic =
new
Container
();
34
$GLOBALS
[
'DIC'
] =
$this->dic
;
35
36
$this->
setGlobalVariable
(
37
'ilSetting'
,
38
$this->getMockBuilder(ilSetting::class)->disableOriginalConstructor()->getMock()
39
);
40
41
parent::setUp();
42
}
43
48
protected
function
setGlobalVariable
(
string
$name, $value): void
49
{
50
global
$DIC
;
51
52
$GLOBALS
[$name] = $value;
53
54
unset($DIC[$name]);
55
$DIC[$name] =
static
function
(
$c
) use ($name) {
56
return
$GLOBALS
[$name];
57
};
58
}
59
60
public
function
testConstructorWithArray
(): void
61
{
62
$testdata = [];
63
$testdata[
'ecs_login'
] =
'testlogin'
;
64
$testdata[
'ecs_firstname'
] =
'test_firstname'
;
65
$testdata[
'ecs_lastname'
] =
'test_lastname'
;
66
67
$testdata[
'ecs_institution'
] =
'test_institution'
;
68
$testdata[
'ecs_email'
] =
'test@email.nowhere'
;
69
$testdata[
'ecs_uid_hash'
] =
'test_hash'
;
70
71
$user =
new
ilECSUser
($testdata);
72
$this->assertEquals(
'testlogin'
, $user->getLogin());
73
}
74
}
ilECSUserTest\setGlobalVariable
setGlobalVariable(string $name, $value)
Definition:
ilECSUserTest.php:48
Factory
ILIAS\DI\Container
Customizing of pimple-DIC for ILIAS.
Definition:
Container.php:35
MockObject
$DIC
global $DIC
Definition:
feed.php:28
Container
ilECSUserTest\testConstructorWithArray
testConstructorWithArray()
Definition:
ilECSUserTest.php:60
ilECSUserTest\setUp
setUp()
Definition:
ilECSUserTest.php:31
$GLOBALS
$GLOBALS["DIC"]
Definition:
wac.php:31
ilECSUserTest
Class ilSessionTest.
Definition:
ilECSUserTest.php:29
$dic
$dic
Definition:
result.php:32
Vendor\Package\$c
$c
Definition:
example_cleaned.php:49
Legacy
TestCase
ilECSUser
Stores relevant user data.
Definition:
class.ilECSUser.php:25
Services
WebServices
ECS
test
ilECSUserTest.php
Generated on Wed Sep 10 2025 14:12:03 for ILIAS by
1.8.13 (using
Doxyfile
)