From a404db66d87d52934be4ba2761386fb46c3cea6d Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Fri, 27 Jun 2014 12:59:28 +0000 Subject: [PATCH] Tests : don't remove $_SERVER variable git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1502 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- Tests/routeTest.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Tests/routeTest.php b/Tests/routeTest.php index 2d49275..9643bd1 100644 --- a/Tests/routeTest.php +++ b/Tests/routeTest.php @@ -18,7 +18,6 @@ class test_route extends PHPUnit_Framework_TestCase public function test_baseURL_2 () { $this->expectOutputString("http://localhost/"); - unset ($_SERVER); $_SERVER["SERVER_NAME"] = "localhost"; $_SERVER["SERVER_PORT"] = 80; $_SERVER["SCRIPT_NAME"] = "/index.php"; @@ -30,7 +29,7 @@ class test_route extends PHPUnit_Framework_TestCase public function test_baseURL_3 () { $this->expectOutputString("https://localhost/"); - unset ($_SERVER); + unset ($_SERVER["HTTPS"]); $_SERVER["SERVER_NAME"] = "localhost"; $_SERVER["SERVER_PORT"] = 443; $_SERVER["HTTPS"] = true; @@ -43,7 +42,7 @@ class test_route extends PHPUnit_Framework_TestCase public function test_baseURL_4 () { $this->expectOutputString("http://localhost:888/"); - unset ($_SERVER); + unset ($_SERVER["HTTPS"]); $_SERVER["SERVER_NAME"] = "localhost"; $_SERVER["SERVER_PORT"] = 888; $_SERVER["SCRIPT_NAME"] = "/index.php"; @@ -55,7 +54,6 @@ class test_route extends PHPUnit_Framework_TestCase public function test_baseURL_5 () { $this->expectOutputString("https://localhost:888/"); - unset ($_SERVER); $_SERVER["SERVER_NAME"] = "localhost"; $_SERVER["SERVER_PORT"] = 888; $_SERVER["HTTPS"] = true; @@ -68,7 +66,7 @@ class test_route extends PHPUnit_Framework_TestCase public function test_baseURL_2_module () { $this->expectOutputString("http://localhost/"); - unset ($_SERVER); + unset ($_SERVER["HTTPS"]); $_SERVER["SERVER_NAME"] = "localhost"; $_SERVER["SERVER_PORT"] = 80; $_SERVER["SCRIPT_NAME"] = "/module/index.php"; @@ -80,7 +78,6 @@ class test_route extends PHPUnit_Framework_TestCase public function test_baseURL_3_module () { $this->expectOutputString("https://localhost/"); - unset ($_SERVER); $_SERVER["SERVER_NAME"] = "localhost"; $_SERVER["SERVER_PORT"] = 443; $_SERVER["HTTPS"] = true; @@ -93,7 +90,7 @@ class test_route extends PHPUnit_Framework_TestCase public function test_baseURL_4_module () { $this->expectOutputString("http://localhost:888/"); - unset ($_SERVER); + unset ($_SERVER["HTTPS"]); $_SERVER["SERVER_NAME"] = "localhost"; $_SERVER["SERVER_PORT"] = 888; $_SERVER["SCRIPT_NAME"] = "/module/index.php"; @@ -105,7 +102,6 @@ class test_route extends PHPUnit_Framework_TestCase public function test_baseURL_5_module () { $this->expectOutputString("https://localhost:888/"); - unset ($_SERVER); $_SERVER["SERVER_NAME"] = "localhost"; $_SERVER["SERVER_PORT"] = 888; $_SERVER["HTTPS"] = true; @@ -118,7 +114,7 @@ class test_route extends PHPUnit_Framework_TestCase public function test_requestURL_2 () { $this->expectOutputString("http://localhost/index.php?var=1"); - unset ($_SERVER); + unset ($_SERVER["HTTPS"]); $_SERVER["SERVER_NAME"] = "localhost"; $_SERVER["SERVER_PORT"] = 80; $_SERVER["REQUEST_URI"] = "/index.php?var=1"; @@ -130,7 +126,6 @@ class test_route extends PHPUnit_Framework_TestCase public function test_requestURL_3 () { $this->expectOutputString("https://localhost/index.php?var=1"); - unset ($_SERVER); $_SERVER["SERVER_NAME"] = "localhost"; $_SERVER["SERVER_PORT"] = 443; $_SERVER["HTTPS"] = true; @@ -143,7 +138,7 @@ class test_route extends PHPUnit_Framework_TestCase public function test_requestURL_4 () { $this->expectOutputString("http://localhost:888/index.php?var=1"); - unset ($_SERVER); + unset ($_SERVER["HTTPS"]); $_SERVER["SERVER_NAME"] = "localhost"; $_SERVER["SERVER_PORT"] = 888; $_SERVER["REQUEST_URI"] = "/index.php?var=1"; @@ -155,7 +150,6 @@ class test_route extends PHPUnit_Framework_TestCase public function test_requestURL_5 () { $this->expectOutputString("https://localhost:888/index.php?var=1"); - unset ($_SERVER); $_SERVER["SERVER_NAME"] = "localhost"; $_SERVER["SERVER_PORT"] = 888; $_SERVER["HTTPS"] = true;