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.

Differences Between: [Versions 401 and 402] [Versions 401 and 403]

mod_bigbluebuttonbn data generator

Author: Jesus Federico (jesus [at] blindsidenetworks [dt] com)
Copyright: 2018 - present, Blindside Networks Inc
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 449 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

mod_bigbluebuttonbn_generator:: (7 methods):
  create_instance()
  get_participants_from_record()
  get_participant_configuration()
  create_recording()
  create_mockserver_recording()
  create_meeting()
  create_log()

extends:: (6 methods):
  log_test_event()
  get_mocked_server_url()
  send_mock_request()
  add_meeting_event()
  send_all_events()
  reset_mock()


Class: mod_bigbluebuttonbn_generator  - X-Ref

bigbluebuttonbn module data generator

create_instance($record = null, array $options = null)   X-Ref
Creates an instance of bigbluebuttonbn for testing purposes.

param: array|stdClass $record data for module being generated.
param: null|array $options general options for course module.
return: stdClass record from module-defined table with additional field cmid

get_participants_from_record(array $record)   X-Ref
Create the participants field data from create_instance data.

param: array $record
return: array

get_participant_configuration(string $field, string $role)   X-Ref
Get the participant configuration for a field and role for use in get_participants_from_record.

param: string $field
param: string $role
return: array

create_recording(array $data, $serveronly = false)   X-Ref
Create a recording for the given bbb activity.

The recording is created both locally, and a recording record is created on the mocked BBB server.

param: array $data
param: bool $serveronly create it only on the server, not in the database.
return: stdClass the recording object

create_mockserver_recording(instance $instance, stdClass $recordingdata, array $data)   X-Ref
Add a recording in the mock server

param: instance $instance
param: stdClass $recordingdata
param: array $data
return: string

create_meeting(array $data)   X-Ref
Mock an in-progress meeting on the remote server.

param: array $data
return: stdClass

create_log($record, array $options = null)   X-Ref
Create a log record

param: mixed $record
param: array|null $options

Class: extends  - X-Ref

log_test_event(instance $instance, array $record)   X-Ref
Log test event

param: instance $instance
param: array $record

get_mocked_server_url(string $endpoint = '', array $params = [])   X-Ref
Get a URL for a mocked BBB server endpoint.

param: string $endpoint
param: array $params
return: moodle_url

send_mock_request(string $endpoint, array $params = [], array $mockdata = [])   X-Ref
Utility to send a request to the mock server

param: string $endpoint
param: array $params
param: array $mockdata
return: SimpleXMLElement|bool

add_meeting_event(object $user, instance $instance, string $eventtype, string $eventdata = '')   X-Ref
Trigger a meeting event on BBB side

param: object $user
param: instance $instance
param: string $eventtype
param: string|null $eventdata
return: void

send_all_events(instance $instance)   X-Ref
Send all previously store events

param: instance $instance
return: object|null

reset_mock()   X-Ref
Reset the mock server