@@ -266,7 +266,6 @@ public function testPopulateHeadersWithoutHTTP(): void
266266 {
267267 // fail path, if argument doesn't have the HTTP_*
268268 $ superglobals = service ('superglobals ' );
269- $ original = $ superglobals ->getServerArray ();
270269 $ superglobals ->setServerArray ([
271270 'USER_AGENT ' => 'Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405 ' ,
272271 'REQUEST_METHOD ' => 'POST ' ,
@@ -276,15 +275,12 @@ public function testPopulateHeadersWithoutHTTP(): void
276275
277276 $ this ->assertNull ($ this ->message ->header ('user-agent ' ));
278277 $ this ->assertNull ($ this ->message ->header ('request-method ' ));
279-
280- $ superglobals ->setServerArray ($ original ); // restore so code coverage doesn't break
281278 }
282279
283280 public function testPopulateHeadersKeyNotExists (): void
284281 {
285282 // Success path, if array key is not exists, assign empty string to it's value
286283 $ superglobals = service ('superglobals ' );
287- $ original = $ superglobals ->getServerArray ();
288284 $ superglobals ->setServerArray ([
289285 'CONTENT_TYPE ' => 'text/html; charset=utf-8 ' ,
290286 'HTTP_ACCEPT_CHARSET ' => null ,
@@ -293,15 +289,12 @@ public function testPopulateHeadersKeyNotExists(): void
293289 $ this ->message ->populateHeaders ();
294290
295291 $ this ->assertSame ('' , $ this ->message ->header ('accept-charset ' )->getValue ());
296-
297- $ superglobals ->setServerArray ($ original ); // restore so code coverage doesn't break
298292 }
299293
300294 public function testPopulateHeaders (): void
301295 {
302296 // success path
303297 $ superglobals = service ('superglobals ' );
304- $ original = $ superglobals ->getServerArray ();
305298 $ superglobals ->setServerArray ([
306299 'CONTENT_TYPE ' => 'text/html; charset=utf-8 ' ,
307300 'HTTP_ACCEPT_LANGUAGE ' => 'en-us,en;q=0.50 ' ,
@@ -311,8 +304,6 @@ public function testPopulateHeaders(): void
311304
312305 $ this ->assertSame ('text/html; charset=utf-8 ' , $ this ->message ->header ('content-type ' )->getValue ());
313306 $ this ->assertSame ('en-us,en;q=0.50 ' , $ this ->message ->header ('accept-language ' )->getValue ());
314-
315- $ superglobals ->setServerArray ($ original ); // restore so code coverage doesn't break
316307 }
317308
318309 public function testAddHeaderAddsFirstHeader (): void
0 commit comments