mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 16:04:25 +02:00
MDL-68658 phpunit: Ensure that the configured proxy is applied always
Previously, if the RSS feed (extests) was being served locally, CFG->proxybypass was applied and causing the test to fail (proxy ignored). In that exact test we need the configured proxy to be applied always, because the test is exaclty about detecting the problem when a wrong proxy is used.
This commit is contained in:
parent
71965a8572
commit
200570558d
@ -118,11 +118,15 @@ EOD;
|
||||
$oldproxy = $CFG->proxyhost;
|
||||
$CFG->proxyhost = 'xxxxxxxxxxxxxxx.moodle.org';
|
||||
|
||||
$oldproxybypass = $CFG->proxybypass; // Ensure we don't get locally served extests bypassing the proxy.
|
||||
$CFG->proxybypass = '';
|
||||
|
||||
$feed = new moodle_simplepie($this->getExternalTestFileUrl('/rsstest.xml'));
|
||||
|
||||
$this->assertNotEmpty($feed->error());
|
||||
$this->assertEmpty($feed->get_title());
|
||||
$CFG->proxyhost = $oldproxy;
|
||||
$CFG->proxybypass = $oldproxybypass;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user