Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

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: 410 lines (20 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.