. /** * HTTPS find and replace Tests * * @package tool_httpsreplace * @copyright Copyright (c) 2016 Blackboard Inc. (http://www.blackboard.com) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace tool_httpsreplace\tests; defined('MOODLE_INTERNAL') || die(); class httpsreplace_test extends \advanced_testcase { /** * Data provider for test_upgrade_http_links */ public function upgrade_http_links_provider() { global $CFG; // Get the http url, since the default test wwwroot is https. $wwwroothttp = preg_replace('/^https:/', 'http:', $CFG->wwwroot); return [ "Test image from another site should be replaced" => [ "content" => '', "outputregex" => '/UPDATE/', "expectedcontent" => '', ], "Test object from another site should be replaced" => [ "content" => '', "outputregex" => '/UPDATE/', "expectedcontent" => '', ], "Link that is from this site should be replaced" => [ "content" => '', "outputregex" => '/UPDATE/', "expectedcontent" => '', ], "Link that is from this site, https new so doesn't need replacing" => [ "content" => '', "outputregex" => '/^$/', "expectedcontent" => '', ], "Unavailable image should be replaced" => [ "content" => '', "outputregex" => '/UPDATE/', "expectedcontent" => '', ], "Https content that has an http url as a param should not be replaced" => [ "content" => '', "outputregex" => '/^$/', "expectedcontent" => '', ], "Known supported domain should be replaced" => [ "content" => '