Merged branch official/master. Resolved merge conflicts introduced due to merging of Piotr and Martynas's branches

This commit is contained in:
ninadsp
2010-08-28 01:53:52 +05:30
172 changed files with 233085 additions and 159854 deletions

View File

@@ -17,6 +17,7 @@ require_once 'PHPUnit/Extensions/OutputTestCase.php';
require_once './libraries/common.lib.php';
require_once './libraries/url_generating.lib.php';
require_once './libraries/core.lib.php';
require_once './libraries/select_lang.lib.php';
/**
* Test function sending headers.
@@ -52,7 +53,7 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
if (function_exists("rename_function"))
$this->apdExt = true;
if ($this->apdExt && !$GLOBALS['test_header']) {
// using apd extension to overriding header and headers_sent functions for test purposes
@@ -83,7 +84,7 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
}
}
public function __destruct()
{
// rename_function may causes CLI error report in Windows XP, but nothing more happen
@@ -105,7 +106,7 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
if ($this->runkitExt) {
$this->oldIISvalue = 'non-defined';
if (defined('PMA_IS_IIS')) {
$this->oldIISvalue = PMA_IS_IIS;
runkit_constant_redefine('PMA_IS_IIS', NULL);
@@ -113,10 +114,10 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
else {
runkit_constant_add('PMA_IS_IIS', NULL);
}
$this->oldSIDvalue = 'non-defined';
if (defined('SID')) {
$this->oldSIDvalue = SID;
runkit_constant_redefine('SID', NULL);
@@ -124,7 +125,7 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
else {
runkit_constant_add('SID', NULL);
}
}
}
@@ -144,7 +145,7 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
runkit_constant_redefine('SID', $this->oldSIDvalue);
elseif (defined('SID')) {
runkit_constant_remove('SID');
}
}
}
if ($this->apdExt)
@@ -152,7 +153,7 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
}
public function testSendHeaderLocationWithSidUrlWithQuestionMark()
{
if ($this->runkitExt && $this->apdExt) {
@@ -161,7 +162,7 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
$testUri = 'http://testurl.com/test.php?test=test';
$separator = PMA_get_arg_separator();
$header = 'Location: ' . $testUri . $separator . SID;
PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header']
@@ -181,7 +182,7 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
$testUri = 'http://testurl.com/test.php';
$separator = PMA_get_arg_separator();
$header = 'Location: ' . $testUri . '?' . SID;
PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header']
@@ -202,7 +203,7 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
$testUri = 'http://testurl.com/test.php';
$separator = PMA_get_arg_separator();
$header = 'Refresh: 0; ' . $testUri;
PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header']
@@ -222,7 +223,7 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
{
if ($this->apdExt) {
$testUri = 'http://testurl.com/test.php';
$testUri = 'http://testurl.com/test.php';
$header = 'Location: ' . $testUri;
PMA_sendHeaderLocation($testUri); // sets $GLOBALS['header']
@@ -242,26 +243,28 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
define('PMA_IS_IIS', true);
else
$this->markTestSkipped('Cannot redefine constant/function - missing APD or/and runkit extension');
// over 600 chars
$testUri = 'http://testurl.com/test.php?testlonguri=over600chars&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test&test=test';
$testUri_html = htmlspecialchars($testUri);
$testUri_js = PMA_escapeJsString($testUri);
$header = "<html><head><title>- - -</title>\n" .
"<meta http-equiv=\"expires\" content=\"0\">\n" .
"<meta http-equiv=\"Pragma\" content=\"no-cache\">\n" .
"<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\n" .
"<meta http-equiv=\"Refresh\" content=\"0;url=" . $testUri . "\">\n" .
"<meta http-equiv=\"Refresh\" content=\"0;url=" . $testUri_html . "\">\n" .
"<script type=\"text/javascript\">\n".
"//<![CDATA[\n" .
"setTimeout(\"window.location = unescape('\"" . $testUri . "\"')\", 2000);\n" .
"setTimeout(\"window.location = unescape('\"" . $testUri_js . "\"')\", 2000);\n" .
"//]]>\n" .
"</script>\n" .
"</head>\n" .
"<body>\n" .
"<script type=\"text/javascript\">\n" .
"//<![CDATA[\n" .
"document.write('<p><a href=\"" . $testUri . "\">" . 'test link' . "</a></p>');\n" .
"document.write('<p><a href=\"" . $testUri_html . "\">" . 'test link' . "</a></p>');\n" .
"//]]>\n" .
"</script></body></html>\n";
@@ -280,7 +283,7 @@ class PMA_headerLocation_test extends PHPUnit_Extensions_OutputTestCase
$GLOBALS['reload'] = true;
$GLOBALS['db'] = 'test_db';
$url = './navigation.php?db='.$GLOBALS['db'];
$url = './navigation.php?db='.$GLOBALS['db'] . '&lang=en-utf-8&convcharset=utf-8';
$write = PHP_EOL . '<script type="text/javascript">' . PHP_EOL .
'//<![CDATA[' . PHP_EOL .
'if (typeof(window.parent) != \'undefined\'' . PHP_EOL .