@@ -49,8 +49,9 @@ private function createSiteURIFactory(array $server, ?App $appConfig = null): Si
4949 public function testDefault (): void
5050 {
5151 // /index.php/woot?code=good#pos
52- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/index.php/woot ' );
53- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/index.php ' );
52+ service ('superglobals ' )
53+ ->setServer ('REQUEST_URI ' , '/index.php/woot ' )
54+ ->setServer ('SCRIPT_NAME ' , '/index.php ' );
5455
5556 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
5657
@@ -61,8 +62,9 @@ public function testDefault(): void
6162 public function testDefaultEmpty (): void
6263 {
6364 // /
64- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/ ' );
65- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/index.php ' );
65+ service ('superglobals ' )
66+ ->setServer ('REQUEST_URI ' , '/ ' )
67+ ->setServer ('SCRIPT_NAME ' , '/index.php ' );
6668
6769 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
6870
@@ -73,8 +75,9 @@ public function testDefaultEmpty(): void
7375 public function testRequestURI (): void
7476 {
7577 // /index.php/woot?code=good#pos
76- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/index.php/woot ' );
77- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/index.php ' );
78+ service ('superglobals ' )
79+ ->setServer ('REQUEST_URI ' , '/index.php/woot ' )
80+ ->setServer ('SCRIPT_NAME ' , '/index.php ' );
7881
7982 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
8083
@@ -93,8 +96,9 @@ public function testRequestURINested(): void
9396 // So I don't remove this test case.
9497
9598 // /ci/index.php/woot?code=good#pos
96- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/index.php/woot ' );
97- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/index.php ' );
99+ service ('superglobals ' )
100+ ->setServer ('REQUEST_URI ' , '/index.php/woot ' )
101+ ->setServer ('SCRIPT_NAME ' , '/index.php ' );
98102
99103 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
100104
@@ -105,8 +109,9 @@ public function testRequestURINested(): void
105109 public function testRequestURISubfolder (): void
106110 {
107111 // /ci/index.php/popcorn/woot?code=good#pos
108- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/ci/index.php/popcorn/woot ' );
109- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/ci/index.php ' );
112+ service ('superglobals ' )
113+ ->setServer ('REQUEST_URI ' , '/ci/index.php/popcorn/woot ' )
114+ ->setServer ('SCRIPT_NAME ' , '/ci/index.php ' );
110115
111116 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
112117
@@ -117,8 +122,9 @@ public function testRequestURISubfolder(): void
117122 public function testRequestURINoIndex (): void
118123 {
119124 // /sub/example
120- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/sub/example ' );
121- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/sub/index.php ' );
125+ service ('superglobals ' )
126+ ->setServer ('REQUEST_URI ' , '/sub/example ' )
127+ ->setServer ('SCRIPT_NAME ' , '/sub/index.php ' );
122128
123129 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
124130
@@ -129,8 +135,9 @@ public function testRequestURINoIndex(): void
129135 public function testRequestURINginx (): void
130136 {
131137 // /ci/index.php/woot?code=good#pos
132- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/index.php/woot?code=good ' );
133- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/index.php ' );
138+ service ('superglobals ' )
139+ ->setServer ('REQUEST_URI ' , '/index.php/woot?code=good ' )
140+ ->setServer ('SCRIPT_NAME ' , '/index.php ' );
134141
135142 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
136143
@@ -141,8 +148,9 @@ public function testRequestURINginx(): void
141148 public function testRequestURINginxRedirecting (): void
142149 {
143150 // /?/ci/index.php/woot
144- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/?/ci/woot ' );
145- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/index.php ' );
151+ service ('superglobals ' )
152+ ->setServer ('REQUEST_URI ' , '/?/ci/woot ' )
153+ ->setServer ('SCRIPT_NAME ' , '/index.php ' );
146154
147155 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
148156
@@ -153,8 +161,9 @@ public function testRequestURINginxRedirecting(): void
153161 public function testRequestURISuppressed (): void
154162 {
155163 // /woot?code=good#pos
156- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/woot ' );
157- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/ ' );
164+ service ('superglobals ' )
165+ ->setServer ('REQUEST_URI ' , '/woot ' )
166+ ->setServer ('SCRIPT_NAME ' , '/ ' );
158167
159168 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
160169
@@ -165,8 +174,9 @@ public function testRequestURISuppressed(): void
165174 public function testRequestURIGetPath (): void
166175 {
167176 // /index.php/fruits/banana
168- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/index.php/fruits/banana ' );
169- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/index.php ' );
177+ service ('superglobals ' )
178+ ->setServer ('REQUEST_URI ' , '/index.php/fruits/banana ' )
179+ ->setServer ('SCRIPT_NAME ' , '/index.php ' );
170180
171181 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
172182
@@ -176,8 +186,9 @@ public function testRequestURIGetPath(): void
176186 public function testRequestURIPathIsRelative (): void
177187 {
178188 // /sub/folder/index.php/fruits/banana
179- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/sub/folder/index.php/fruits/banana ' );
180- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/sub/folder/index.php ' );
189+ service ('superglobals ' )
190+ ->setServer ('REQUEST_URI ' , '/sub/folder/index.php/fruits/banana ' )
191+ ->setServer ('SCRIPT_NAME ' , '/sub/folder/index.php ' );
181192
182193 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
183194
@@ -187,8 +198,9 @@ public function testRequestURIPathIsRelative(): void
187198 public function testRequestURIStoresDetectedPath (): void
188199 {
189200 // /fruits/banana
190- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/fruits/banana ' );
191- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/index.php ' );
201+ service ('superglobals ' )
202+ ->setServer ('REQUEST_URI ' , '/fruits/banana ' )
203+ ->setServer ('SCRIPT_NAME ' , '/index.php ' );
192204
193205 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
194206
@@ -199,8 +211,9 @@ public function testRequestURIStoresDetectedPath(): void
199211
200212 public function testRequestURIPathIsNeverRediscovered (): void
201213 {
202- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/fruits/banana ' );
203- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/index.php ' );
214+ service ('superglobals ' )
215+ ->setServer ('REQUEST_URI ' , '/fruits/banana ' )
216+ ->setServer ('SCRIPT_NAME ' , '/index.php ' );
204217
205218 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
206219
@@ -213,11 +226,11 @@ public function testRequestURIPathIsNeverRediscovered(): void
213226 public function testQueryString (): void
214227 {
215228 // /index.php?/ci/woot
216- service ('superglobals ' )-> setServer ( ' REQUEST_URI ' , ' /index.php?/ci/woot ' );
217- service ( ' superglobals ' ) ->setServer ('QUERY_STRING ' , '/ci/woot ' );
218- service ( ' superglobals ' ) ->setServer ('SCRIPT_NAME ' , '/index.php ' );
219-
220- service ( ' superglobals ' ) ->setGet ('/ci/woot ' , '' );
229+ service ('superglobals ' )
230+ ->setServer ('REQUEST_URI ' , '/index.php?/ ci/woot ' )
231+ ->setServer ('QUERY_STRING ' , '/ci/woot ' )
232+ -> setServer ( ' SCRIPT_NAME ' , ' /index.php ' )
233+ ->setGet ('/ci/woot ' , '' );
221234
222235 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
223236
@@ -228,11 +241,11 @@ public function testQueryString(): void
228241 public function testQueryStringWithQueryString (): void
229242 {
230243 // /index.php?/ci/woot?code=good#pos
231- service ('superglobals ' )-> setServer ( ' REQUEST_URI ' , ' /index.php?/ci/woot?code=good ' );
232- service ( ' superglobals ' ) ->setServer ('QUERY_STRING ' , '/ci/woot?code=good ' );
233- service ( ' superglobals ' ) ->setServer ('SCRIPT_NAME ' , '/index.php ' );
234-
235- service ( ' superglobals ' ) ->setGet ('/ci/woot?code ' , 'good ' );
244+ service ('superglobals ' )
245+ ->setServer ('REQUEST_URI ' , '/index.php?/ ci/woot?code=good ' )
246+ ->setServer ('QUERY_STRING ' , '/ci/woot?code=good ' )
247+ -> setServer ( ' SCRIPT_NAME ' , ' /index.php ' )
248+ ->setGet ('/ci/woot?code ' , 'good ' );
236249
237250 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
238251
@@ -245,8 +258,9 @@ public function testQueryStringWithQueryString(): void
245258 public function testQueryStringEmpty (): void
246259 {
247260 // /index.php?
248- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/index.php? ' );
249- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/index.php ' );
261+ service ('superglobals ' )
262+ ->setServer ('REQUEST_URI ' , '/index.php? ' )
263+ ->setServer ('SCRIPT_NAME ' , '/index.php ' );
250264
251265 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
252266
@@ -257,8 +271,9 @@ public function testQueryStringEmpty(): void
257271 public function testPathInfoUnset (): void
258272 {
259273 // /index.php/woot?code=good#pos
260- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/index.php/woot ' );
261- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/index.php ' );
274+ service ('superglobals ' )
275+ ->setServer ('REQUEST_URI ' , '/index.php/woot ' )
276+ ->setServer ('SCRIPT_NAME ' , '/index.php ' );
262277
263278 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray ());
264279
@@ -272,9 +287,10 @@ public function testPathInfoSubfolder(): void
272287 $ appConfig ->baseURL = 'http://localhost:8888/ci431/public/ ' ;
273288
274289 // http://localhost:8888/ci431/public/index.php/woot?code=good#pos
275- service ('superglobals ' )->setServer ('PATH_INFO ' , '/woot ' );
276- service ('superglobals ' )->setServer ('REQUEST_URI ' , '/ci431/public/index.php/woot?code=good ' );
277- service ('superglobals ' )->setServer ('SCRIPT_NAME ' , '/ci431/public/index.php ' );
290+ service ('superglobals ' )
291+ ->setServer ('PATH_INFO ' , '/woot ' )
292+ ->setServer ('REQUEST_URI ' , '/ci431/public/index.php/woot?code=good ' )
293+ ->setServer ('SCRIPT_NAME ' , '/ci431/public/index.php ' );
278294
279295 $ factory = $ this ->createSiteURIFactory (service ('superglobals ' )->getServerArray (), $ appConfig );
280296
0 commit comments