Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

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

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.

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

create_users_file($courseid, $updateuserspassword, ?int $size = null)   X-Ref
Creates the users data 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
return: stored_file

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

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

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

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
return: string The users csv file contents.

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

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

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

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

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

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