ILIAS  release_8 Revision v8.24
CatStandardGUIRequestTest Class Reference

Test clipboard repository. More...

+ Inheritance diagram for CatStandardGUIRequestTest:
+ Collaboration diagram for CatStandardGUIRequestTest:

Public Member Functions

 testRefId ()
 Test ref id. More...
 
 testNoRefId ()
 Test no ref id. More...
 
 testBaseClass ()
 Test base class. More...
 
 testCmdClass ()
 Test cmd class. More...
 
 testTerm ()
 Test term. More...
 
 testTermByPost ()
 Test term by post. More...
 
 testPostBeatsGet ()
 Test that post values overwrite get values. More...
 
 testFetchAll ()
 Test fetch all. More...
 
 testRoleIds ()
 Test role ids. More...
 
 testUserIds ()
 Test user ids. More...
 
 testObjId ()
 Test obj id. More...
 

Protected Member Functions

 tearDown ()
 
 getRequest (array $get, array $post)
 

Detailed Description

Test clipboard repository.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 12 of file CatStandardGUIRequestTest.php.

Member Function Documentation

◆ getRequest()

CatStandardGUIRequestTest::getRequest ( array  $get,
array  $post 
)
protected

Definition at line 18 of file CatStandardGUIRequestTest.php.

19 {
20 $http_mock = $this->createMock(ILIAS\HTTP\Services::class);
21 $lng_mock = $this->createMock(ilLanguage::class);
22 $data = new \ILIAS\Data\Factory();
23 $refinery = new \ILIAS\Refinery\Factory($data, $lng_mock);
24 return new \ILIAS\Category\StandardGUIRequest(
25 $http_mock,
27 $get,
28 $post
29 );
30 }
$post
Definition: ltitoken.php:49
Refinery Factory $refinery
Class ChatMainBarProvider \MainMenu\Provider.

References $data, $post, and ILIAS\Repository\$refinery.

Referenced by testBaseClass(), testCmdClass(), testFetchAll(), testNoRefId(), testObjId(), testPostBeatsGet(), testRefId(), testRoleIds(), testTerm(), testTermByPost(), and testUserIds().

+ Here is the caller graph for this function:

◆ tearDown()

CatStandardGUIRequestTest::tearDown ( )
protected

Definition at line 14 of file CatStandardGUIRequestTest.php.

14 : void
15 {
16 }

◆ testBaseClass()

CatStandardGUIRequestTest::testBaseClass ( )

Test base class.

Definition at line 70 of file CatStandardGUIRequestTest.php.

70 : void
71 {
72 $request = $this->getRequest(
73 [
74 "baseClass" => "myClass"
75 ],
76 []
77 );
78
79 $this->assertEquals(
80 "myClass",
81 $request->getBaseClass()
82 );
83 }
getRequest(array $get, array $post)

References getRequest().

+ Here is the call graph for this function:

◆ testCmdClass()

CatStandardGUIRequestTest::testCmdClass ( )

Test cmd class.

Definition at line 88 of file CatStandardGUIRequestTest.php.

88 : void
89 {
90 $request = $this->getRequest(
91 [
92 "cmdClass" => "myClass"
93 ],
94 []
95 );
96
97 $this->assertEquals(
98 "myClass",
99 $request->getCmdClass()
100 );
101 }

References getRequest().

+ Here is the call graph for this function:

◆ testFetchAll()

CatStandardGUIRequestTest::testFetchAll ( )

Test fetch all.

Definition at line 163 of file CatStandardGUIRequestTest.php.

163 : void
164 {
165 $request = $this->getRequest(
166 [
167 "fetchall" => "1"
168 ],
169 []
170 );
171
172 $this->assertEquals(
173 1,
174 $request->getFetchAll()
175 );
176 }

References getRequest().

+ Here is the call graph for this function:

◆ testNoRefId()

CatStandardGUIRequestTest::testNoRefId ( )

Test no ref id.

Definition at line 53 of file CatStandardGUIRequestTest.php.

53 : void
54 {
55 $request = $this->getRequest(
56 [
57 ],
58 []
59 );
60
61 $this->assertEquals(
62 0,
63 $request->getRefId()
64 );
65 }

References getRequest().

+ Here is the call graph for this function:

◆ testObjId()

CatStandardGUIRequestTest::testObjId ( )

Test obj id.

Definition at line 223 of file CatStandardGUIRequestTest.php.

223 : void
224 {
225 $request = $this->getRequest(
226 [
227 "obj_id" => "15"
228 ],
229 [
230 ]
231 );
232
233 $this->assertEquals(
234 15,
235 $request->getObjId()
236 );
237 }

References getRequest().

+ Here is the call graph for this function:

◆ testPostBeatsGet()

CatStandardGUIRequestTest::testPostBeatsGet ( )

Test that post values overwrite get values.

Definition at line 143 of file CatStandardGUIRequestTest.php.

143 : void
144 {
145 $request = $this->getRequest(
146 [
147 "term" => "one"
148 ],
149 [
150 "term" => "two"
151 ]
152 );
153
154 $this->assertEquals(
155 "two",
156 $request->getTerm()
157 );
158 }

References getRequest().

+ Here is the call graph for this function:

◆ testRefId()

CatStandardGUIRequestTest::testRefId ( )

Test ref id.

Definition at line 35 of file CatStandardGUIRequestTest.php.

35 : void
36 {
37 $request = $this->getRequest(
38 [
39 "ref_id" => "5"
40 ],
41 []
42 );
43
44 $this->assertEquals(
45 5,
46 $request->getRefId()
47 );
48 }

References getRequest().

+ Here is the call graph for this function:

◆ testRoleIds()

CatStandardGUIRequestTest::testRoleIds ( )

Test role ids.

Definition at line 181 of file CatStandardGUIRequestTest.php.

181 : void
182 {
183 $request = $this->getRequest(
184 [
185 ],
186 [
187 "role_ids" => [
188 "6", "7", "9"
189 ]
190 ]
191 );
192
193 $this->assertEquals(
194 [6,7,9],
195 $request->getRoleIds()
196 );
197 }

References getRequest().

+ Here is the call graph for this function:

◆ testTerm()

CatStandardGUIRequestTest::testTerm ( )

Test term.

Definition at line 106 of file CatStandardGUIRequestTest.php.

106 : void
107 {
108 $request = $this->getRequest(
109 [
110 "term" => "my_term"
111 ],
112 []
113 );
114
115 $this->assertEquals(
116 "my_term",
117 $request->getTerm()
118 );
119 }

References getRequest().

+ Here is the call graph for this function:

◆ testTermByPost()

CatStandardGUIRequestTest::testTermByPost ( )

Test term by post.

Definition at line 124 of file CatStandardGUIRequestTest.php.

124 : void
125 {
126 $request = $this->getRequest(
127 [
128 ],
129 [
130 "term" => "my_term"
131 ]
132 );
133
134 $this->assertEquals(
135 "my_term",
136 $request->getTerm()
137 );
138 }

References getRequest().

+ Here is the call graph for this function:

◆ testUserIds()

CatStandardGUIRequestTest::testUserIds ( )

Test user ids.

Definition at line 202 of file CatStandardGUIRequestTest.php.

202 : void
203 {
204 $request = $this->getRequest(
205 [
206 ],
207 [
208 "user_ids" => [
209 "6", "7", "10"
210 ]
211 ]
212 );
213
214 $this->assertEquals(
215 [6,7,10],
216 $request->getUserIds()
217 );
218 }

References getRequest().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: