Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Component generator base class. More...
Public Member Functions | |
__construct (testing_data_generator $datagenerator) | |
Constructor. More... | |
reset () | |
To be called from data reset code only, do not use in tests. More... | |
Protected Member Functions | |
set_user (?stdClass $user=null) | |
Set the current user during data generation. More... | |
Protected Attributes | |
testing_data_generator | $datagenerator |
Component generator base class.
Extend in path/to/component/tests/generator/lib.php as class type_plugin_generator extends component_generator_base Note that there are more specific classes to extend for mods and blocks.
component_generator_base::__construct | ( | testing_data_generator | $datagenerator | ) |
Constructor.
testing_data_generator | $datagenerator |
component_generator_base::reset | ( | ) |
To be called from data reset code only, do not use in tests.
void |
Reimplemented in tool_dataprivacy_generator, core_competency_generator, testing_block_generator, testing_module_generator, testing_repository_generator, mod_book_generator, mod_chat_generator, mod_data_generator, mod_forum_generator, mod_glossary_generator, mod_lesson_generator, mod_survey_generator, mod_wiki_generator, core_notes_generator, and core_question_generator.
|
protected |
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.
stdClass | $user |