Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 310] [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

Test classes for handling embedded media.

Copyright: 2016 Marina Glancy
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 398 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: media_videojs_player_testcase  - X-Ref

Test script for media embedding.

setUp()   X-Ref
Pre-test setup. Preserves $CFG.


test_is_installed()   X-Ref
Test that plugin is returned as enabled media plugin.


test_supported_extensions()   X-Ref
Test method get_supported_extensions()


test_embed_url()   X-Ref
Test embedding without media filter (for example for displaying file resorce).


test_embed_link()   X-Ref
Test that mediaplugin filter replaces a link to the supported file with media tag.

filter_mediaplugin is enabled by default.

test_fallback()   X-Ref
Test that only supported URLs are listed as sources but all URLs are present in links fallbacks.


test_prevent_other_players()   X-Ref
Assert other players do not apply after videojs was applied.


test_embed_media()   X-Ref
Test that mediaplugin filter adds player code on top of <video> tags.

filter_mediaplugin is enabled by default.

youtube_plugin_engaged($t)   X-Ref
Helper function for testing youtube videos embedding.

param: string $t output of core_media_manager::embed_url.

test_youtube()   X-Ref
Test that VideoJS can embed youtube videos.


youtube_start_time_provider()   X-Ref
Data provider for {@see test_youtube_start_time}

return: array

test_youtube_start_time(string $url, int $expectedstart)   X-Ref
Test Youtube video embedding with URL's containing start time interval

param: string $url
param: int $expectedstart

flash_plugin_engaged($t)   X-Ref
Helper function for testing flash videos embedding.

param: string $t output of core_media_manager::embed_url.

test_flash()   X-Ref
Test that VideoJS can embed flash videos.


test_rtmp()   X-Ref
Test that VideoJS can embed RTMP streams.