MDL-52487 rss: PHP 7 compatible error supression
PHP5 used to update error_reporting to 0 on functions called with the suppress errors operator (@). In PHP7 it is not updated. Credit to Rajesh Taneja
This commit is contained in:
@@ -99,7 +99,12 @@ EOD;
|
||||
* Test retrieving a url which doesn't exist.
|
||||
*/
|
||||
public function test_failurl() {
|
||||
$feed = @new moodle_simplepie($this->getExternalTestFileUrl('/rsstest-which-doesnt-exist.xml'), self::TIMEOUT); // We do not want this in php error log.
|
||||
global $CFG;
|
||||
|
||||
// We do not want this in php error log.
|
||||
$errorlevel = error_reporting($CFG->debug & ~E_USER_NOTICE);
|
||||
$feed = new moodle_simplepie($this->getExternalTestFileUrl('/rsstest-which-doesnt-exist.xml'), self::TIMEOUT);
|
||||
error_reporting($errorlevel);
|
||||
|
||||
$this->assertNotEmpty($feed->error());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user