Wikimedia
Create tests for UploadFromUrl::isAllowedHost
MediaWiki allows users to upload images as files, but also from URLs, by copying them from the specified URL and upload them to the wiki.
This behaviour can be limited to specific URLs, which is part of the configuration variable $wgCopyUploadsDomains[1]. The implementation of that is in the function UploadFromUrl::isAllowedHost, however, this method is not really tested to have this specific behaviour.
Your task is to find a suitable amount of test data and write test cases for the method in order to improve our test coverage and make future changes to this functionality easier and failsafe.
[1] https://www.mediawiki.org/wiki/Manual:$wgCopyUploadsDomains
Task tags
Students who completed this task
taavi