From 200570558da5deaccdf5c170d31bf548a285bcf1 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sun, 10 May 2020 16:54:14 +0200 Subject: [PATCH] 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. --- lib/tests/rsslib_test.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tests/rsslib_test.php b/lib/tests/rsslib_test.php index 51648c998f7..c724f6a53b8 100644 --- a/lib/tests/rsslib_test.php +++ b/lib/tests/rsslib_test.php @@ -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; } /*