Merge pull request #1773 from nisargjhaveri/tests
Fix tests, use proxy settings from env
This commit is contained in:
commit
135289ca25
@ -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();
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user