ILIAS
release_10 Revision v10.1-43-ga1241a92c2f
◀ ilDoc Overview
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
21
use
ILIAS\Data\Factory
as
DataFactory
;
22
use
ILIAS\HTTP\Wrapper\SuperGlobalDropInReplacement
;
23
use
ILIAS\Refinery\Factory
as
Refinery
;
24
use
ilLanguage
;
25
use
OutOfBoundsException
;
26
27
class
SuperGlobalDropInReplacementTest
extends
AbstractBaseTestCase
28
{
29
private
function
getRefinery
():
Refinery
30
{
31
return
new
Refinery
(
32
new
DataFactory
(),
33
$this->getMockBuilder(ilLanguage::class)->disableOriginalConstructor()->getMock()
34
);
35
}
36
37
public
function
testValueCanBeAssignedIfSuperGlobalIsMutable
(): void
38
{
39
$super_global =
new
SuperGlobalDropInReplacement
($this->
getRefinery
(), [
'foo'
=>
'bar'
]);
40
$super_global[
'foo'
] =
'phpunit'
;
41
42
self::assertEquals(
'phpunit'
, $super_global[
'foo'
]);
43
}
44
45
public
function
testExceptionIsRaisedIfValueIsAssignedButSuperGlobalIsImmutable
(): void
46
{
47
$this->expectException(OutOfBoundsException::class);
48
49
$super_global =
new
SuperGlobalDropInReplacement
($this->
getRefinery
(), [
'foo'
=>
'bar'
],
true
);
50
$super_global[
'foo'
] =
'phpunit'
;
51
}
52
}
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:45
SuperGlobalDropInReplacement
ILIAS\HTTP\Wrapper\SuperGlobalDropInReplacement
Class SuperGlobalDropInReplacement This Class wraps SuperGlobals such as $_GET and $_POST to prevent ...
Definition:
SuperGlobalDropInReplacement.php:33
ILIAS\HTTP\SuperGlobalDropInReplacementTest\getRefinery
getRefinery()
Definition:
SuperGlobalDropInReplacementTest.php:29
Factory
Factory
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
OutOfBoundsException
ILIAS\HTTP\SuperGlobalDropInReplacementTest\testValueCanBeAssignedIfSuperGlobalIsMutable
testValueCanBeAssignedIfSuperGlobalIsMutable()
Definition:
SuperGlobalDropInReplacementTest.php:37
ILIAS\HTTP\SuperGlobalDropInReplacementTest
Definition:
SuperGlobalDropInReplacementTest.php:27
ILIAS\HTTP\AbstractBaseTestCase
Class AbstractBaseTest.
Definition:
AbstractBaseTestCase.php:28
components
ILIAS
HTTP
tests
Services
SuperGlobalDropInReplacementTest.php
Generated on Wed Sep 10 2025 15:15:45 for ILIAS by
1.8.13 (using
Doxyfile
)