.
/**
* 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 {
public function test_find_and_replace() {
global $DB;
$this->resetAfterTest();
$this->expectOutputRegex("/UPDATE/");
$finder = new \tool_httpsreplace\url_finder();
$results = $finder->http_link_stats();
$this->assertEmpty($results);
$generator = $this->getDataGenerator();
$imglink1 = '
';
$course1 = $generator->create_course((object) [
'summary' => $imglink1,
]);
$imglink2 = '
';
$course2 = $generator->create_course((object) [
'summary' => $imglink2,
]);
$imglink3 = '
';
$course3 = $generator->create_course((object) [
'summary' => $imglink1.$imglink2.$imglink3,
]);
$kaltura = '