ILIAS
trunk Revision v11.0_alpha-2662-g519ff7d528f
◀ ilDoc Overview
BlogStandardGUIRequestTest.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
use
PHPUnit\Framework\TestCase
;
22
26
class
BlogStandardGUIRequestTest
extends
TestCase
27
{
28
//protected $backupGlobals = false;
29
30
protected
function
tearDown
(): void
31
{
32
}
33
34
protected
function
getRequest
(array $get, array
$post
): \
ILIAS
\Blog\StandardGUIRequest
35
{
36
$http_mock = $this->createMock(
ILIAS
\
HTTP
\Services::class);
37
$lng_mock = $this->createMock(ilLanguage::class);
38
$data
= new \ILIAS\Data\Factory();
39
$refinery
= new \ILIAS\Refinery\Factory(
$data
, $lng_mock);
40
return
new \ILIAS\Blog\StandardGUIRequest(
41
$http_mock,
42
$refinery
,
43
$get,
44
$post
45
);
46
}
47
48
public
function
testRefId
()
49
{
50
$request = $this->
getRequest
(
51
[
52
"ref_id"
=>
"5"
53
],
54
[]
55
);
56
57
$this->assertEquals(
58
5,
59
$request->getRefId()
60
);
61
}
62
63
public
function
testBlogPage
()
64
{
65
$request = $this->
getRequest
(
66
[
67
"blpg"
=>
"6"
68
],
69
[]
70
);
71
72
$this->assertEquals(
73
6,
74
$request->getBlogPage()
75
);
76
}
77
78
public
function
testObjIds
()
79
{
80
$request = $this->
getRequest
(
81
[
82
],
83
[
84
"obj_id"
=> [
"3"
,
"7"
]
85
]
86
);
87
88
$this->assertEquals(
89
[3,7],
90
$request->getObjIds()
91
);
92
}
93
94
public
function
testIds
()
95
{
96
$request = $this->
getRequest
(
97
[
98
],
99
[
100
"id"
=> [
"12"
,
"17"
]
101
]
102
);
103
104
$this->assertEquals(
105
[12,17],
106
$request->getIds()
107
);
108
}
109
110
public
function
testUserLogin
()
111
{
112
$request = $this->
getRequest
(
113
[
114
"user_login"
=>
"my_login"
115
],
116
[]
117
);
118
119
$this->assertEquals(
120
"my_login"
,
121
$request->getUserLogin()
122
);
123
}
124
125
public
function
testKeyword
()
126
{
127
$request = $this->
getRequest
(
128
[
129
"kwd"
=>
"my_keyw"
130
],
131
[]
132
);
133
134
$this->assertEquals(
135
"my_keyw"
,
136
$request->getKeyword()
137
);
138
}
139
}
$data
$data
Definition:
ltiregistration.php:29
ILIAS\UI\examples\Layout\Page\Standard\$refinery
$refinery
Definition:
ui.php:137
BlogStandardGUIRequestTest\testKeyword
testKeyword()
Definition:
BlogStandardGUIRequestTest.php:125
ILIAS
Interface Observer Contains several chained tasks and infos about them.
Definition:
AccessControl.php:21
BlogStandardGUIRequestTest\testIds
testIds()
Definition:
BlogStandardGUIRequestTest.php:94
BlogStandardGUIRequestTest
Definition:
BlogStandardGUIRequestTest.php:26
BlogStandardGUIRequestTest\testObjIds
testObjIds()
Definition:
BlogStandardGUIRequestTest.php:78
Services
BlogStandardGUIRequestTest\testRefId
testRefId()
Definition:
BlogStandardGUIRequestTest.php:48
BlogStandardGUIRequestTest\testBlogPage
testBlogPage()
Definition:
BlogStandardGUIRequestTest.php:63
BlogStandardGUIRequestTest\testUserLogin
testUserLogin()
Definition:
BlogStandardGUIRequestTest.php:110
BlogStandardGUIRequestTest\tearDown
tearDown()
Definition:
BlogStandardGUIRequestTest.php:30
$post
$post
Definition:
ltitoken.php:46
TestCase
TestCase
BlogStandardGUIRequestTest\getRequest
getRequest(array $get, array $post)
Definition:
BlogStandardGUIRequestTest.php:34
components
ILIAS
Blog
tests
BlogStandardGUIRequestTest.php
Generated on Wed Sep 3 2025 23:02:30 for ILIAS by
1.8.13 (using
Doxyfile
)