Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNisarg Jhaveri <nisargjhaveri@gmail.com>2015-07-02 17:07:30 +0300
committerNisarg Jhaveri <nisargjhaveri@gmail.com>2015-07-02 17:38:03 +0300
commit0c704996fa5dfa51252d5c6f8f3d4045428a20ba (patch)
tree7e87091e79dc691b7367baf5f74226c81529233e /test
parent1a316a69864c53cc11de5fde6921010fbd8e9896 (diff)
Fix tests, use proxy settings from env
Signed-off-by: Nisarg Jhaveri <nisargjhaveri@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/bootstrap-dist.php12
-rw-r--r--test/classes/PMA_Util_test.php5
2 files changed, 15 insertions, 2 deletions
diff --git a/test/bootstrap-dist.php b/test/bootstrap-dist.php
index dbac6be22c..865e6f770b 100644
--- a/test/bootstrap-dist.php
+++ b/test/bootstrap-dist.php
@@ -56,6 +56,18 @@ $CFG = new PMA_Config();
define('PMA_VERSION', $CFG->get('PMA_VERSION'));
unset($CFG);
+// Set proxy information from env, if available
+$http_proxy = getenv('http_proxy');
+if ($http_proxy && ($url_info = parse_url($http_proxy))) {
+ define('PROXY_URL', $url_info['host'] . ':' . $url_info['port']);
+ define('PROXY_USER', empty($url_info['user']) ? '' : $url_info['user']);
+ define('PROXY_PASS', empty($url_info['pass']) ? '' : $url_info['pass']);
+} else {
+ define('PROXY_URL', '');
+ define('PROXY_USER', '');
+ define('PROXY_PASS', '');
+}
+
// Ensure we have session started
session_start();
diff --git a/test/classes/PMA_Util_test.php b/test/classes/PMA_Util_test.php
index 20c851d23d..e88b0237d6 100644
--- a/test/classes/PMA_Util_test.php
+++ b/test/classes/PMA_Util_test.php
@@ -116,8 +116,9 @@ class PMA_Util_Test extends PHPUnit_Framework_TestCase
*/
public function testGetLatestVersion()
{
- $GLOBALS['cfg']['ProxyUrl'] = '';
- $GLOBALS['cfg']['VersionCheckProxyUrl'] = '';
+ $GLOBALS['cfg']['ProxyUrl'] = PROXY_URL;
+ $GLOBALS['cfg']['ProxyUser'] = PROXY_USER;
+ $GLOBALS['cfg']['ProxyPass'] = PROXY_PASS;
$GLOBALS['cfg']['VersionCheck'] = true;
$version = PMA_Util::getLatestVersion();
$this->assertNotEmpty($version->version);