mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
Merge branch 'MDL-42985-master' of git://github.com/FMCorz/moodle
This commit is contained in:
commit
a184b3d712
2 changed files with 27 additions and 3 deletions
|
@ -375,6 +375,28 @@ class core_filelib_testcase extends advanced_testcase {
|
|||
$this->assertSame(0, $curl->get_errno());
|
||||
$this->assertSame(1, $curl->info['redirect_count']);
|
||||
$this->assertSame('done', $contents);
|
||||
|
||||
$oldproxy = $CFG->proxyhost;
|
||||
$oldproxybypass = $CFG->proxybypass;
|
||||
|
||||
// Test without proxy bypass and inaccessible proxy.
|
||||
$CFG->proxyhost = 'i.do.not.exist';
|
||||
$CFG->proxybypass = '';
|
||||
$curl = new curl();
|
||||
$contents = $curl->get($testhtml);
|
||||
$this->assertNotEquals(0, $curl->get_errno());
|
||||
$this->assertNotEquals('47250a973d1b88d9445f94db4ef2c97a', md5($contents));
|
||||
|
||||
// Test with proxy bypass.
|
||||
$testhtmlhost = parse_url($testhtml, PHP_URL_HOST);
|
||||
$CFG->proxybypass = $testhtmlhost;
|
||||
$curl = new curl();
|
||||
$contents = $curl->get($testhtml);
|
||||
$this->assertSame(0, $curl->get_errno());
|
||||
$this->assertSame('47250a973d1b88d9445f94db4ef2c97a', md5($contents));
|
||||
|
||||
$CFG->proxyhost = $oldproxy;
|
||||
$CFG->proxybypass = $oldproxybypass;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue