Tests : don't remove $_SERVER variable

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1502 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2014-06-27 12:59:28 +00:00
parent 052a8a8d1a
commit a404db66d8

View File

@@ -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;