ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 28 of file CatStandardGUIRequestTest.php.

Member Function Documentation

◆ getRequest()

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

Definition at line 34 of file CatStandardGUIRequestTest.php.

References $data, and ILIAS\UI\examples\Layout\Page\Standard\$refinery.

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

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\Category\StandardGUIRequest(
41  $http_mock,
42  $refinery,
43  $get,
44  $post
45  );
46  }
Interface Observer Contains several chained tasks and infos about them.
$post
Definition: ltitoken.php:46
+ Here is the caller graph for this function:

◆ tearDown()

CatStandardGUIRequestTest::tearDown ( )
protected

Definition at line 30 of file CatStandardGUIRequestTest.php.

30  : void
31  {
32  }

◆ testBaseClass()

CatStandardGUIRequestTest::testBaseClass ( )

Test base class.

Definition at line 86 of file CatStandardGUIRequestTest.php.

References getRequest().

86  : void
87  {
88  $request = $this->getRequest(
89  [
90  "baseClass" => "myClass"
91  ],
92  []
93  );
94 
95  $this->assertEquals(
96  "myClass",
97  $request->getBaseClass()
98  );
99  }
getRequest(array $get, array $post)
+ Here is the call graph for this function:

◆ testCmdClass()

CatStandardGUIRequestTest::testCmdClass ( )

Test cmd class.

Definition at line 104 of file CatStandardGUIRequestTest.php.

References getRequest().

104  : void
105  {
106  $request = $this->getRequest(
107  [
108  "cmdClass" => "myClass"
109  ],
110  []
111  );
112 
113  $this->assertEquals(
114  "myClass",
115  $request->getCmdClass()
116  );
117  }
getRequest(array $get, array $post)
+ Here is the call graph for this function:

◆ testFetchAll()

CatStandardGUIRequestTest::testFetchAll ( )

Test fetch all.

Definition at line 179 of file CatStandardGUIRequestTest.php.

References getRequest().

179  : void
180  {
181  $request = $this->getRequest(
182  [
183  "fetchall" => "1"
184  ],
185  []
186  );
187 
188  $this->assertEquals(
189  1,
190  $request->getFetchAll()
191  );
192  }
getRequest(array $get, array $post)
+ Here is the call graph for this function:

◆ testNoRefId()

CatStandardGUIRequestTest::testNoRefId ( )

Test no ref id.

Definition at line 69 of file CatStandardGUIRequestTest.php.

References getRequest().

69  : void
70  {
71  $request = $this->getRequest(
72  [
73  ],
74  []
75  );
76 
77  $this->assertEquals(
78  0,
79  $request->getRefId()
80  );
81  }
getRequest(array $get, array $post)
+ Here is the call graph for this function:

◆ testObjId()

CatStandardGUIRequestTest::testObjId ( )

Test obj id.

Definition at line 239 of file CatStandardGUIRequestTest.php.

References getRequest().

239  : void
240  {
241  $request = $this->getRequest(
242  [
243  "obj_id" => "15"
244  ],
245  [
246  ]
247  );
248 
249  $this->assertEquals(
250  15,
251  $request->getObjId()
252  );
253  }
getRequest(array $get, array $post)
+ Here is the call graph for this function:

◆ testPostBeatsGet()

CatStandardGUIRequestTest::testPostBeatsGet ( )

Test that post values overwrite get values.

Definition at line 159 of file CatStandardGUIRequestTest.php.

References getRequest().

159  : void
160  {
161  $request = $this->getRequest(
162  [
163  "term" => "one"
164  ],
165  [
166  "term" => "two"
167  ]
168  );
169 
170  $this->assertEquals(
171  "two",
172  $request->getTerm()
173  );
174  }
getRequest(array $get, array $post)
+ Here is the call graph for this function:

◆ testRefId()

CatStandardGUIRequestTest::testRefId ( )

Test ref id.

Definition at line 51 of file CatStandardGUIRequestTest.php.

References getRequest().

51  : void
52  {
53  $request = $this->getRequest(
54  [
55  "ref_id" => "5"
56  ],
57  []
58  );
59 
60  $this->assertEquals(
61  5,
62  $request->getRefId()
63  );
64  }
getRequest(array $get, array $post)
+ Here is the call graph for this function:

◆ testRoleIds()

CatStandardGUIRequestTest::testRoleIds ( )

Test role ids.

Definition at line 197 of file CatStandardGUIRequestTest.php.

References getRequest().

197  : void
198  {
199  $request = $this->getRequest(
200  [
201  ],
202  [
203  "role_ids" => [
204  "6", "7", "9"
205  ]
206  ]
207  );
208 
209  $this->assertEquals(
210  [6,7,9],
211  $request->getRoleIds()
212  );
213  }
getRequest(array $get, array $post)
+ Here is the call graph for this function:

◆ testTerm()

CatStandardGUIRequestTest::testTerm ( )

Test term.

Definition at line 122 of file CatStandardGUIRequestTest.php.

References getRequest().

122  : void
123  {
124  $request = $this->getRequest(
125  [
126  "term" => "my_term"
127  ],
128  []
129  );
130 
131  $this->assertEquals(
132  "my_term",
133  $request->getTerm()
134  );
135  }
getRequest(array $get, array $post)
+ Here is the call graph for this function:

◆ testTermByPost()

CatStandardGUIRequestTest::testTermByPost ( )

Test term by post.

Definition at line 140 of file CatStandardGUIRequestTest.php.

References getRequest().

140  : void
141  {
142  $request = $this->getRequest(
143  [
144  ],
145  [
146  "term" => "my_term"
147  ]
148  );
149 
150  $this->assertEquals(
151  "my_term",
152  $request->getTerm()
153  );
154  }
getRequest(array $get, array $post)
+ Here is the call graph for this function:

◆ testUserIds()

CatStandardGUIRequestTest::testUserIds ( )

Test user ids.

Definition at line 218 of file CatStandardGUIRequestTest.php.

References getRequest().

218  : void
219  {
220  $request = $this->getRequest(
221  [
222  ],
223  [
224  "user_ids" => [
225  "6", "7", "10"
226  ]
227  ]
228  );
229 
230  $this->assertEquals(
231  [6,7,10],
232  $request->getUserIds()
233  );
234  }
getRequest(array $get, array $post)
+ Here is the call graph for this function:

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