Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
mod_bigbluebuttonbn_generator Class Reference

bigbluebuttonbn module data generator More...

Inheritance diagram for mod_bigbluebuttonbn_generator:
testing_module_generator component_generator_base

Public Member Functions

 add_meeting_event (object $user, instance $instance, string $eventtype, string $eventdata='')
 Trigger a meeting event on BBB side.
 
 create_content ($instance, $record=array())
 Generates a piece of content for the module.
 
 create_instance ($record=null, array $options=null)
 Creates an instance of bigbluebuttonbn for testing purposes.
 
 create_log ($record, array $options=null)
 Create a log record.
 
 create_meeting (array $data)
 Mock an in-progress meeting on the remote server.
 
 create_recording (array $data, $serveronly=false)
 Create a recording for the given bbb activity.
 
 get_modulename ()
 Returns module name.
 
 reset ()
 To be called from data reset code only, do not use in tests.
 
 reset_mock ()
 Reset the mock server.
 
 send_all_events (instance $instance)
 Send all previously store events.
 
 set_value (string $name, $value)
 Set a value in the Mock server.
 

Protected Member Functions

 create_mockserver_recording (instance $instance, stdClass $recordingdata, array $data)
 Add a recording in the mock server.
 
 get_mocked_server_url (string $endpoint='', array $params=[])
 Get a URL for a mocked BBB server endpoint.
 
 get_participant_configuration (string $field, string $role)
 Get the participant configuration for a field and role for use in get_participants_from_record.
 
 get_participants_from_record (array $record)
 Create the participants field data from create_instance data.
 
 insert_files (stdClass $instance, stdClass $record, string $table, context $context, string $component, string $filearea, int $targetitemid)
 Update the instance record, inserting any files that are referenced.
 
 post_add_instance ($id, $cmid)
 Called after *_add_instance()
 
 precreate_course_module ($courseid, array $options)
 Create course module and link it to course.
 
 prepare_moduleinfo_record ($record, $options)
 Merges together arguments $record and $options and fills default module fields that are shared by all module types.
 
 send_mock_request (string $endpoint, array $params=[], array $mockdata=[])
 Utility to send a request to the mock server.
 
 set_user (?stdClass $user=null)
 Set the current user during data generation.
 

Protected Attributes

testing_data_generator $datagenerator
 
int $instancecount = 0
 number of created instances
 

Detailed Description

bigbluebuttonbn module data generator

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Author
Jesus Federico (jesus [at] blindsidenetworks [dt] com)

Member Function Documentation

◆ add_meeting_event()

mod_bigbluebuttonbn_generator::add_meeting_event ( object $user,
instance $instance,
string $eventtype,
string $eventdata = '' )

Trigger a meeting event on BBB side.

Parameters
object$user
instance$instance
string$eventtype
string | null$eventdata
Return values
void

◆ create_content()

testing_module_generator::create_content ( $instance,
$record = array() )
inherited

Generates a piece of content for the module.

User is usually taken from global $USER variable.

Parameters
stdClass$instanceobject returned from create_instance() call
stdClass | array$record
Return values
stdClassgenerated object
Exceptions
coding_exceptionif function is not implemented by module

Reimplemented in mod_book_generator, mod_forum_generator, mod_h5pactivity_generator, mod_lesson_generator, and mod_wiki_generator.

◆ create_instance()

mod_bigbluebuttonbn_generator::create_instance ( $record = null,
array $options = null )

Creates an instance of bigbluebuttonbn for testing purposes.

Parameters
array | stdClass$recorddata for module being generated.
null | array$optionsgeneral options for course module.
Return values
stdClassrecord from module-defined table with additional field cmid

Reimplemented from testing_module_generator.

◆ create_log()

mod_bigbluebuttonbn_generator::create_log ( $record,
array $options = null )

Create a log record.

Parameters
mixed$record
array | null$options

◆ create_meeting()

mod_bigbluebuttonbn_generator::create_meeting ( array $data)

Mock an in-progress meeting on the remote server.

Parameters
array$data
Return values
stdClass

◆ create_mockserver_recording()

mod_bigbluebuttonbn_generator::create_mockserver_recording ( instance $instance,
stdClass $recordingdata,
array $data )
protected

Add a recording in the mock server.

Parameters
instance$instance
stdClass$recordingdata
array$data
Return values
string

◆ create_recording()

mod_bigbluebuttonbn_generator::create_recording ( array $data,
$serveronly = false )

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.

Parameters
array$data
bool$serveronlycreate it only on the server, not in the database.
Return values
stdClassthe recording object

◆ get_mocked_server_url()

mod_bigbluebuttonbn_generator::get_mocked_server_url ( string $endpoint = '',
array $params = [] )
protected

Get a URL for a mocked BBB server endpoint.

Parameters
string$endpoint
array$params
Return values
moodle_url

◆ get_modulename()

testing_module_generator::get_modulename ( )
inherited

Returns module name.

Return values
stringname of module that this class describes
Exceptions
coding_exceptionif class invalid

◆ get_participant_configuration()

mod_bigbluebuttonbn_generator::get_participant_configuration ( string $field,
string $role )
protected

Get the participant configuration for a field and role for use in get_participants_from_record.

Parameters
string$field
string$role
Return values
array

◆ get_participants_from_record()

mod_bigbluebuttonbn_generator::get_participants_from_record ( array $record)
protected

Create the participants field data from create_instance data.

Parameters
array$record
Return values
array

◆ insert_files()

component_generator_base::insert_files ( stdClass $instance,
stdClass $record,
string $table,
context $context,
string $component,
string $filearea,
int $targetitemid )
protectedinherited

Update the instance record, inserting any files that are referenced.

Parameters
stdClass$instanceThe instance record of the already-created record
stdClass$recordThe data passed in to create the instance
string$tableThe table that the data exists in
context$contextThe context of the instance
string$componentThe component of the owning plugin
string$fileareaThe name of the file area
int$targetitemidThe itemid to use when saving the files
Return values
stdClassThe updated instance record

◆ post_add_instance()

testing_module_generator::post_add_instance ( $id,
$cmid )
protectedinherited

Called after *_add_instance()

Since 2.6 it is recommended to use function add_moduleinfo() to create a module.

Deprecated
since 2.6
See also
testing_module_generator\create_instance()
Parameters
int$id
int$cmid
Return values
stdClassmodule instance

◆ precreate_course_module()

testing_module_generator::precreate_course_module ( $courseid,
array $options )
protectedinherited

Create course module and link it to course.

Since 2.6 it is recommended to use function add_moduleinfo() to create a module.

Deprecated
since 2.6
See also
testing_module_generator\create_instance()
Parameters
integer$courseid
array$optionssection, visible
Return values
integer\$cminstance id

◆ prepare_moduleinfo_record()

testing_module_generator::prepare_moduleinfo_record ( $record,
$options )
protectedinherited

Merges together arguments $record and $options and fills default module fields that are shared by all module types.

Parameters
object | array$recordfields (different from defaults) for this module
null | array$optionsfor backward-compatibility this may include fields from course_modules table. They are merged into $record
Exceptions
coding_exceptionif $record->course is not specified

◆ reset()

testing_module_generator::reset ( )
inherited

To be called from data reset code only, do not use in tests.

Return values
void

Reimplemented from component_generator_base.

Reimplemented in mod_book_generator, mod_chat_generator, mod_data_generator, mod_forum_generator, mod_glossary_generator, mod_lesson_generator, mod_survey_generator, and mod_wiki_generator.

◆ send_all_events()

mod_bigbluebuttonbn_generator::send_all_events ( instance $instance)

Send all previously store events.

Parameters
instance$instance
Return values
object|null

◆ send_mock_request()

mod_bigbluebuttonbn_generator::send_mock_request ( string $endpoint,
array $params = [],
array $mockdata = [] )
protected

Utility to send a request to the mock server.

Parameters
string$endpoint
array$params
array$mockdata
Return values
SimpleXMLElement|bool
Exceptions
moodle_exception

◆ set_user()

component_generator_base::set_user ( ?stdClass $user = null)
protectedinherited

Set the current user during data generation.

This should be avoided wherever possible, but in some situations underlying code will insert data as the current user.

Parameters
stdClass$user

◆ set_value()

mod_bigbluebuttonbn_generator::set_value ( string $name,
$value )

Set a value in the Mock server.

Parameters
string$name
mixed$value
Return values
void
Exceptions
moodle_exception

The documentation for this class was generated from the following file: