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:
Eloy Lafuente (stronk7)
2020-05-22 17:07:10 +02:00
parent 38cc6d1071
commit 4e60865e2c
+4
View File
@@ -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;
}
/*