Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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

Test plan generator.

Copyright: 2013 David MonllaĆ³
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 317 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: tool_generator_testplan_backend  - X-Ref

Generates the files required by JMeter.

get_size_choices()   X-Ref
Gets a list of size choices supported by this backend.

return: array List of size (int) => text description for display

get_repourl()   X-Ref
Getter for moodle-performance-comparison project URL.

return: string

create_testplan_file($courseid, $size)   X-Ref
Creates the test plan file.

return: stored_file
param: int $courseid The target course id
param: int $size The test plan size

create_users_file($courseid, $updateuserspassword, ?int $size = null)   X-Ref
Creates the users data file.

return: stored_file
param: int $courseid The target course id
param: bool $updateuserspassword Updates the course users password to $CFG->tool_generator_users_password
param: int|null $size of the test plan. Used to limit the number of users exported

generate_test_plan($targetcourseid, $size)   X-Ref
Generates the test plan according to the target course contents.

return: string The test plan as a string
param: int $targetcourseid The target course id
param: int $size The test plan size

generate_users_file($targetcourseid, $updateuserspassword, ?int $size = null)   X-Ref
Generates the user's credentials file with all the course's users

return: string The users csv file contents.
param: int $targetcourseid
param: bool $updateuserspassword Updates the course users password to $CFG->tool_generator_users_password
param: int|null $size of the test plan. Used to limit the number of users exported

get_file_record($filearea, $filetype)   X-Ref
Returns a tool_generator file record

return: stdClass The file record to use when creating tool_generator files
param: string $filearea testplan or users
param: string $filetype The file extension jmx or csv

get_course_test_data($targetcourseid)   X-Ref
Gets the data required to fill the test plan template with the database contents.

return: stdClass The ids required by the test plan
param: int $targetcourseid The target course id

has_selected_course_any_problem($course, $size)   X-Ref
Checks if the selected target course is ok.

return: array Errors array or false if everything is ok
param: int|string $course
param: int $size