ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
AdminGUIRequestTest Class Reference

Test administration request class. More...

+ Inheritance diagram for AdminGUIRequestTest:
+ Collaboration diagram for AdminGUIRequestTest:

Public Member Functions

 testRefId ()
 Test ref id. More...
 
 testNoRefId ()
 Test no ref id. More...
 
 testAdminMode ()
 Test admin mode. More...
 
 testSelectedIds ()
 Test selected ids. More...
 
 testNewType ()
 Test new type. More...
 
 testUserId ()
 Test user id. More...
 
 testPluginId ()
 Test plugin id. More...
 

Protected Member Functions

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

Detailed Description

Test administration request class.

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

Definition at line 26 of file AdminGUIRequestTest.php.

Member Function Documentation

◆ getRequest()

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

Definition at line 39 of file AdminGUIRequestTest.php.

40 {
41 $http_mock = $this->createMock(ILIAS\HTTP\Services::class);
42 $lng_mock = $this->createMock(ilLanguage::class);
43 $data = new \ILIAS\Data\Factory();
44 $refinery = new \ILIAS\Refinery\Factory($data, $lng_mock);
45 return new \ILIAS\Administration\AdminGUIRequest(
46 $http_mock,
48 $get,
49 $post
50 );
51 }
$post
Definition: ltitoken.php:46
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

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

Referenced by testAdminMode(), testNewType(), testNoRefId(), testPluginId(), testRefId(), testSelectedIds(), and testUserId().

+ Here is the caller graph for this function:

◆ setUp()

AdminGUIRequestTest::setUp ( )
protected

Definition at line 30 of file AdminGUIRequestTest.php.

30 : void
31 {
32 parent::setUp();
33 }

◆ tearDown()

AdminGUIRequestTest::tearDown ( )
protected

Definition at line 35 of file AdminGUIRequestTest.php.

35 : void
36 {
37 }

◆ testAdminMode()

AdminGUIRequestTest::testAdminMode ( )

Test admin mode.

Definition at line 91 of file AdminGUIRequestTest.php.

91 : void
92 {
93 $request = $this->getRequest(
94 [
95 "admin_mode" => "repository"
96 ],
97 []
98 );
99
100 $this->assertEquals(
101 "repository",
102 $request->getAdminMode()
103 );
104 }
getRequest(array $get, array $post)

References getRequest().

+ Here is the call graph for this function:

◆ testNewType()

AdminGUIRequestTest::testNewType ( )

Test new type.

Definition at line 128 of file AdminGUIRequestTest.php.

128 : void
129 {
130 $request = $this->getRequest(
131 [
132 "new_type" => "usr"
133 ],
134 []
135 );
136
137 $this->assertEquals(
138 "usr",
139 $request->getNewType()
140 );
141 }

References getRequest().

+ Here is the call graph for this function:

◆ testNoRefId()

AdminGUIRequestTest::testNoRefId ( )

Test no ref id.

Definition at line 74 of file AdminGUIRequestTest.php.

74 : void
75 {
76 $request = $this->getRequest(
77 [
78 ],
79 []
80 );
81
82 $this->assertEquals(
83 0,
84 $request->getRefId()
85 );
86 }

References getRequest().

+ Here is the call graph for this function:

◆ testPluginId()

AdminGUIRequestTest::testPluginId ( )

Test plugin id.

Definition at line 164 of file AdminGUIRequestTest.php.

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

References getRequest().

+ Here is the call graph for this function:

◆ testRefId()

AdminGUIRequestTest::testRefId ( )

Test ref id.

Definition at line 56 of file AdminGUIRequestTest.php.

56 : void
57 {
58 $request = $this->getRequest(
59 [
60 "ref_id" => "5"
61 ],
62 []
63 );
64
65 $this->assertEquals(
66 5,
67 $request->getRefId()
68 );
69 }

References getRequest().

+ Here is the call graph for this function:

◆ testSelectedIds()

AdminGUIRequestTest::testSelectedIds ( )

Test selected ids.

Definition at line 109 of file AdminGUIRequestTest.php.

109 : void
110 {
111 $request = $this->getRequest(
112 [
113 ],
114 [
115 "id" => ["1", "2", "3"]
116 ]
117 );
118
119 $this->assertEquals(
120 [1,2,3],
121 $request->getSelectedIds()
122 );
123 }

References getRequest().

+ Here is the call graph for this function:

◆ testUserId()

AdminGUIRequestTest::testUserId ( )

Test user id.

Definition at line 146 of file AdminGUIRequestTest.php.

146 : void
147 {
148 $request = $this->getRequest(
149 [
150 "jmpToUser" => "15"
151 ],
152 []
153 );
154
155 $this->assertEquals(
156 15,
157 $request->getJumpToUserId()
158 );
159 }

References getRequest().

+ Here is the call graph for this function:

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