ILIAS
release_8 Revision v8.19
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
j
l
m
p
s
t
u
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
v
x
+
Variables
$
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
SuperGlobalDropInReplacementTest.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
5
/******************************************************************************
6
*
7
* This file is part of ILIAS, a powerful learning management system.
8
*
9
* ILIAS is licensed with the GPL-3.0, you should have received a copy
10
* of said license along with the source code.
11
*
12
* If this is not the case or you just want to try ILIAS, you'll find
13
* us at:
14
* https://www.ilias.de
15
* https://github.com/ILIAS-eLearning
16
*
17
*****************************************************************************/
18
19
namespace
ILIAS\HTTP
;
20
22
require_once
"AbstractBaseTest.php"
;
23
24
use
ILIAS\Data\Factory
as
DataFactory
;
25
use
ILIAS\HTTP\Wrapper\SuperGlobalDropInReplacement
;
26
use
ILIAS\Refinery\Factory
as
Refinery
;
27
use
ilLanguage
;
28
use
OutOfBoundsException
;
29
30
class
SuperGlobalDropInReplacementTest
extends
AbstractBaseTest
31
{
32
private
function
getRefinery
():
Refinery
33
{
34
return
new
Refinery
(
35
new
DataFactory
(),
36
$this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock()
37
);
38
}
39
40
public
function
testValueCanBeAssignedIfSuperGlobalIsMutable
(): void
41
{
42
$super_global =
new
SuperGlobalDropInReplacement
($this->
getRefinery
(), [
'foo'
=>
'bar'
]);
43
$super_global[
'foo'
] =
'phpunit'
;
44
45
self::assertEquals(
'phpunit'
, $super_global[
'foo'
]);
46
}
47
48
public
function
testExceptionIsRaisedIfValueIsAssignedButSuperGlobalIsImmutable
(): void
49
{
50
$this->expectException(OutOfBoundsException::class);
51
52
$super_global =
new
SuperGlobalDropInReplacement
($this->
getRefinery
(), [
'foo'
=>
'bar'
],
true
);
53
$super_global[
'foo'
] =
'phpunit'
;
54
}
55
}
ILIAS\HTTP
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilLanguage
ILIAS\HTTP\SuperGlobalDropInReplacementTest\testExceptionIsRaisedIfValueIsAssignedButSuperGlobalIsImmutable
testExceptionIsRaisedIfValueIsAssignedButSuperGlobalIsImmutable()
Definition:
SuperGlobalDropInReplacementTest.php:48
SuperGlobalDropInReplacement
ILIAS\HTTP\Wrapper\SuperGlobalDropInReplacement
Class SuperGlobalDropInReplacement This Class wraps SuperGlobals such as $_GET and $_POST to prevent ...
Definition:
SuperGlobalDropInReplacement.php:30
ILIAS\HTTP\SuperGlobalDropInReplacementTest\getRefinery
getRefinery()
Definition:
SuperGlobalDropInReplacementTest.php:32
ILIAS\HTTP\AbstractBaseTest
Class AbstractBaseTest.
Definition:
AbstractBaseTest.php:28
Factory
Factory
OutOfBoundsException
ILIAS\HTTP\SuperGlobalDropInReplacementTest\testValueCanBeAssignedIfSuperGlobalIsMutable
testValueCanBeAssignedIfSuperGlobalIsMutable()
Definition:
SuperGlobalDropInReplacementTest.php:40
ILIAS\HTTP\SuperGlobalDropInReplacementTest
Definition:
SuperGlobalDropInReplacementTest.php:30
tests
HTTP
Services
SuperGlobalDropInReplacementTest.php
Generated on Tue Apr 1 2025 22:02:50 for ILIAS by
1.8.13 (using
Doxyfile
)