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
PostDataFromServerRequestTest.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
21
require_once(__DIR__ .
"/../../../../../../libs/composer/vendor/autoload.php"
);
22
23
use
ILIAS\UI\Implementation\Component\Input\PostDataFromServerRequest
;
24
use
Psr\Http\Message\ServerRequestInterface
;
25
use
PHPUnit\Framework\TestCase
;
26
27
class
PostDataFromServerRequestTest
extends
TestCase
28
{
29
protected
PostDataFromServerRequest
$post_data
;
30
31
public
function
setUp
(): void
32
{
33
$request = Mockery::mock(ServerRequestInterface::class);
34
$request->shouldReceive(
"getParsedBody"
)->andReturn([
"foo"
=>
"bar"
]);
35
$this->post_data =
new
PostDataFromServerRequest
($request);
36
}
37
38
public
function
test_get_success
(): void
39
{
40
$this->assertEquals(
"bar"
, $this->post_data->get(
"foo"
));
41
}
42
43
public
function
test_get_fail
(): void
44
{
45
$raised =
false
;
46
try
{
47
$this->post_data->get(
"baz"
);
48
}
catch
(
LogicException
$e
) {
49
$raised =
true
;
50
}
51
$this->assertTrue($raised,
"Logic exception was raised."
);
52
}
53
54
public
function
test_getOr_match
(): void
55
{
56
$this->assertEquals(
"bar"
, $this->post_data->getOr(
"foo"
,
"baz"
));
57
}
58
59
public
function
test_getOr_no_match
(): void
60
{
61
$this->assertEquals(
"blaw"
, $this->post_data->getOr(
"baz"
,
"blaw"
));
62
}
63
}
LogicException
ILIAS\UI\Implementation\Component\Input\PostDataFromServerRequest
Implements interaction of input element with post data from psr-7 server request. ...
Definition:
PostDataFromServerRequest.php:30
PostDataFromServerRequestTest\$post_data
PostDataFromServerRequest $post_data
Definition:
PostDataFromServerRequestTest.php:29
PostDataFromServerRequest
PostDataFromServerRequestTest\test_getOr_match
test_getOr_match()
Definition:
PostDataFromServerRequestTest.php:54
PostDataFromServerRequestTest\test_getOr_no_match
test_getOr_no_match()
Definition:
PostDataFromServerRequestTest.php:59
Vendor\Package\$e
$e
Definition:
example_cleaned.php:49
PostDataFromServerRequestTest
Definition:
PostDataFromServerRequestTest.php:27
ServerRequestInterface
PostDataFromServerRequestTest\test_get_fail
test_get_fail()
Definition:
PostDataFromServerRequestTest.php:43
PostDataFromServerRequestTest\setUp
setUp()
Definition:
PostDataFromServerRequestTest.php:31
PostDataFromServerRequestTest\test_get_success
test_get_success()
Definition:
PostDataFromServerRequestTest.php:38
TestCase
tests
UI
Component
Input
Container
Form
PostDataFromServerRequestTest.php
Generated on Sun Apr 6 2025 22:03:06 for ILIAS by
1.8.13 (using
Doxyfile
)