ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
PollBlockTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
use
PHPUnit\Framework\TestCase
;
22
27
class
PollBlockTest
extends
TestCase
28
{
29
protected
ilPollBlock
$poll_block
;
30
31
protected
function
setGlobalVariable
(
string
$name, $value): void
32
{
33
global
$DIC
;
34
35
$GLOBALS
[$name] = $value;
36
37
unset($DIC[$name]);
38
$DIC[$name] =
static
function
(
\ILIAS\DI\Container
$c
) use ($value) {
39
return
$value;
40
};
41
}
42
43
44
protected
function
setUp
(): void
45
{
46
parent::setUp();
47
48
$dic
=
new
ILIAS\DI\Container
();
49
$GLOBALS
[
'DIC'
] =
$dic
;
50
51
$db = $this->createMock(ilDBInterface::class);
52
$lng
= $this->createMock(ilLanguage::class);
53
54
$this->
setGlobalVariable
(
55
"ilDB"
,
56
$db
57
);
58
$this->
setGlobalVariable
(
59
"lng"
,
60
$lng
61
);
62
63
$this->poll_block =
new
ilPollBlock
();
64
}
65
66
protected
function
tearDown
(): void
67
{
68
}
69
70
public
function
testSetTitle
(): void
71
{
72
$pb =
$this->poll_block
;
73
$pb->
setTitle
(
"A poll block"
);
74
75
$this->assertEquals(
76
"A poll block"
,
77
$pb->getTitle()
78
);
79
}
80
}
PollBlockTest\tearDown
tearDown()
Definition:
PollBlockTest.php:66
PollBlockTest\testSetTitle
testSetTitle()
Definition:
PollBlockTest.php:70
ilCustomBlock\setTitle
setTitle(string $a_title)
Definition:
class.ilCustomBlock.php:111
$c
$c
Definition:
deliver.php:25
ILIAS\DI\Container
Customizing of pimple-DIC for ILIAS.
Definition:
Container.php:35
PollBlockTest\$poll_block
ilPollBlock $poll_block
Definition:
PollBlockTest.php:29
Container
$GLOBALS
$GLOBALS["DIC"]
Definition:
wac.php:53
PollBlockTest
Test class ilPollBlock.
Definition:
PollBlockTest.php:27
PollBlockTest\setGlobalVariable
setGlobalVariable(string $name, $value)
Definition:
PollBlockTest.php:31
$DIC
global $DIC
Definition:
shib_login.php:26
ilPollBlock
Custom block for polls.
Definition:
class.ilPollBlock.php:26
$lng
global $lng
Definition:
privfeed.php:31
$dic
$dic
Definition:
result.php:31
TestCase
PollBlockTest\setUp
setUp()
Definition:
PollBlockTest.php:44
TestCase
components
ILIAS
Poll
tests
PollBlockTest.php
Generated on Sun Aug 31 2025 23:03:31 for ILIAS by
1.8.13 (using
Doxyfile
)