Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Class: instance_test  - X-Ref

Tests for the Big Blue Button Instance.

test_get_from(string $function, string $field)   X-Ref
Test get from

param: string $function
param: string $field

get_from_location_provider()   X-Ref
Get from location provider

return: string[][]

test_get_from_cmid()   X-Ref
Get an instance from a cmid.


test_get_from_cmid_not_found()   X-Ref
If the instance was not found, and exception should be thrown.


test_get_from_instance_not_found()   X-Ref
If the instance was not found, and exception should be thrown.


test_get_from_meetingid()   X-Ref
Get from meeting id


test_get_from_meetingid_group()   X-Ref
Get the get_from_meetingid() function where the meetingid includes a groupid.


test_get_from_meetingid_invalid(string $meetingid)   X-Ref
Ensure that invalid meetingids throw an appropriate exception.

param: string $meetingid

invalid_meetingid_provider()   X-Ref
Provide invalid meeting examples

return: \string[][]

test_get_all_instances_in_course()   X-Ref
Test the get_all_instances_in_course function.


get_test_instance(array $data = [])   X-Ref
Get test instance from data

param: array $data
return: array

test_get_meeting_id_with_groups()   X-Ref
Test the get_meeting_id function for a meeting configured for a group.


test_get_meeting_id_without_groups()   X-Ref
Test the get_meeting_id function for a meeting configured for a group.


is_currently_open_provider()   X-Ref
Data provider to check the various room_available scenarios'

return: array

test_is_currently_open(?int $openingtime, ?int $closingtime, bool $expected)   X-Ref
Check instance currently open

param: null|int $openingtime
param: null|int $closingtime
param: bool $expected

test_user_must_wait_to_join(bool $isadmin, bool $ismoderator, bool $haswaitingroom, bool $expected)   X-Ref
Ensure that the user_must_wait_to_join function works as expectd.

param: bool $isadmin
param: bool $ismoderator
param: bool $haswaitingroom
param: bool $expected

user_must_wait_to_join_provider()   X-Ref
Data provider for the user_must_wait_to_join function.

return: array

test_does_current_user_count_towards_user_limit(bool $isadmin,bool $ismoderator,bool $expected)   X-Ref
Ensure that the does_current_user_count_towards_user_limit function works as expectd.

param: bool $isadmin
param: bool $ismoderator
param: bool $expected

does_current_user_count_towards_user_limit_provider()   X-Ref
Data provider for the does_current_user_count_towards_user_limit function.

return: array

test_get_current_user_password(bool $isadmin, bool $ismoderator, bool $expectedmodpassword)   X-Ref
Ensure that the does_current_user_count_towards_user_limit function works as expectd.

param: bool $isadmin
param: bool $ismoderator
param: bool $expectedmodpassword

get_current_user_password_provider()   X-Ref
Data provider for the get_current_user_password function.

return: array

test_get_current_user_role(bool $isadmin, bool $ismoderator, bool $expectedmodrole)   X-Ref
Ensure that the get_current_user_role function works as expected.

param: bool $isadmin
param: bool $ismoderator
param: bool $expectedmodrole

get_current_user_role_provider()   X-Ref
Data provider for the get_current_user_role function.

return: array

test_allow_recording_start_stop(bool $isrecorded,bool $showbuttons,bool $expected)   X-Ref
Tests for the allow_recording_start_stop function.

param: bool $isrecorded
param: bool $showbuttons
param: bool $expected

allow_recording_start_stop_provider()   X-Ref
Data provider for the allow_recording_start_stop function.

return: array

test_get_user_id()   X-Ref
Test get user id (guest or current user)


test_get_guest_access_url()   X-Ref
Test guest access URL


test_is_guest_allowed()   X-Ref
Test guest allowed flag


get_guest_access_password()   X-Ref
Test guest access password