Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
.
/**
* Unit tests for the filter_displayh5p
*
* @package filter_displayh5p
* @category test
* @copyright 2019 Victor Deniz
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace filter_displayh5p;
use filter_displayh5p;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot.'/filter/displayh5p/filter.php');
/**
* Unit tests for the display H5P filter.
*
* @copyright 2019 Victor Deniz
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class filter_test extends \advanced_testcase {
public function setUp(): void {
parent::setUp();
$this->resetAfterTest(true);
set_config('allowedsources',
"https://moodle.h5p.com/content/[id]/embed\nhttps://moodle.h5p.com/content/[id]
\nhttps://generic.wordpress.soton.ac.uk/altc/wp-admin/admin-ajax.php?action=h5p_embed&id=[id]",
'filter_displayh5p');
}
/**
* Check that h5p tags with urls from allowed domains are filtered.
*
* @param string $text Original text
* @param string $filteredtextpattern Text pattern after display H5P filter
*
* @dataProvider texts_provider
*/
public function test_filter_urls($text, $filteredtextpattern) {
$filterplugin = new filter_displayh5p(null, array());
$filteredtext = $filterplugin->filter($text);
$this->assertMatchesRegularExpression($filteredtextpattern, $filteredtext);
}
/**
* Provides texts to filter for the {@link self::test_filter_urls} method.
*
* @return array
*/
public function texts_provider() {
global $CFG;
return [
["http:://example.com", "#http:://example.com#"],
["http://google.es/h5p/embed/3425234", "#http://google.es/h5p/embed/3425234#"],
["https://moodle.h5p.com/content/1290729733828858779/embed", "#