◆ create_content()
mod_forum_generator::create_content |
( |
|
$instance, |
|
|
|
$record = array() |
|
) |
| |
Generates a piece of content for the module.
User is usually taken from global $USER variable.
- Parameters
-
- Return values
-
- Exceptions
-
Reimplemented from testing_module_generator.
◆ create_discussion()
mod_forum_generator::create_discussion |
( |
|
$record = null | ) |
|
Function to create a dummy discussion.
- Parameters
-
- Return values
-
stdClass | the discussion object |
◆ create_instance()
mod_forum_generator::create_instance |
( |
|
$record = null , |
|
|
array |
$options = null |
|
) |
| |
Creates an instance of the module for testing purposes.
Module type will be taken from the class name. Each module type may overwrite this function to add other default values used by it.
- Parameters
-
array | stdClass | $record | data for module being generated. Requires 'course' key (an id or the full object). Also can have any fields from add module form. |
null | array | $options | general options for course module. Since 2.6 it is possible to omit this argument by merging options into $record |
- Return values
-
stdClass | record from module-defined table with additional field cmid (corresponding id in course_modules table) |
Reimplemented from testing_module_generator.
◆ create_post()
mod_forum_generator::create_post |
( |
|
$record = null | ) |
|
Function to create a dummy post.
- Parameters
-
- Return values
-
◆ create_subscription()
mod_forum_generator::create_subscription |
( |
|
$record = null | ) |
|
Function to create a dummy subscription.
- Parameters
-
- Return values
-
stdClass | the subscription object |
◆ get_author_subheading_html()
mod_forum_generator::get_author_subheading_html |
( |
stdClass |
$exportedauthor, |
|
|
int |
$timecreated |
|
) |
| |
Extracted from exporter/post.php.
Get the HTML to display as a subheading in a post.
- Parameters
-
stdClass | $exportedauthor | The exported author object |
int | $timecreated | The post time created timestamp if it's to be displayed |
- Return values
-
◆ get_modulename()
testing_module_generator::get_modulename |
( |
| ) |
|
|
inherited |
Returns module name.
- Return values
-
string | name of module that this class describes |
- Exceptions
-
◆ post_add_instance()
testing_module_generator::post_add_instance |
( |
|
$id, |
|
|
|
$cmid |
|
) |
| |
|
protectedinherited |
◆ precreate_course_module()
testing_module_generator::precreate_course_module |
( |
|
$courseid, |
|
|
array |
$options |
|
) |
| |
|
protectedinherited |
◆ 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 | $record | fields (different from defaults) for this module |
null | array | $options | for backward-compatibility this may include fields from course_modules table. They are merged into $record |
- Exceptions
-
◆ reset()
mod_forum_generator::reset |
( |
| ) |
|
The documentation for this class was generated from the following file: