Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

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

Feedback module external functions tests

Copyright: 2017 Juan Leyva <juan@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1295 lines (58 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: external_test  - X-Ref

Feedback module external functions tests

setUp()   X-Ref
Set up for every test


populate_feedback($feedback, $pagescount = 1)   X-Ref
Helper method to add items to an existing feedback.

param: \stdClass $feedback feedback instance
param: integer $pagescount the number of pages we want in the feedback
return: array list of items created

test_mod_feedback_get_feedbacks_by_courses()   X-Ref
Test test_mod_feedback_get_feedbacks_by_courses


test_get_feedback_access_information_student()   X-Ref
Test get_feedback_access_information function with basic defaults for student.


test_get_feedback_access_information_teacher()   X-Ref
Test get_feedback_access_information function with basic defaults for teacher.


test_view_feedback_invalid_id()   X-Ref
Test view_feedback invalid id.


test_view_feedback_not_enrolled_user()   X-Ref
Test view_feedback not enrolled user.


test_view_feedback_no_capabilities()   X-Ref
Test view_feedback no capabilities.


test_view_feedback()   X-Ref
Test view_feedback.


test_get_current_completed_tmp()   X-Ref
Test get_current_completed_tmp.


test_get_items()   X-Ref
Test get_items.


test_get_items_validation(string $role, array $info, ?string $warning)   X-Ref
Test get_items, to confirm validation is done too.

param: string $role Whether the current user should be a student or a teacher.
param: array $info Settings to create the feedback.
param: string|null $warning The warning message to display or null if warnings result is empty.

items_provider()   X-Ref
Data provider for test_get_items_validation() and test_get_page_items_validation().

return: array

test_launch_feedback()   X-Ref
Test launch_feedback.


test_get_page_items()   X-Ref
Test get_page_items.


test_get_page_items_validation(string $role, array $info, ?string $warning)   X-Ref
Test get_page_items, to confirm validation is done too.

param: string $role Whether the current user should be a student or a teacher.
param: array $info Settings to create the feedback.
param: string|null $warning The warning message to display or null if warnings result is empty.

test_process_page()   X-Ref
Test process_page.


test_process_page_site_feedback()   X-Ref
Test process_page for a site feedback.


test_get_analysis()   X-Ref
Test get_analysis.


test_get_unfinished_responses()   X-Ref
Test get_unfinished_responses.


test_get_finished_responses()   X-Ref
Test get_finished_responses.


test_get_non_respondents_no_permissions()   X-Ref
Test get_non_respondents (student trying to get this information).


test_get_non_respondents_from_anonymous_feedback()   X-Ref
Test get_non_respondents from an anonymous feedback.


test_get_non_respondents()   X-Ref
Test get_non_respondents.


complete_basic_feedback()   X-Ref
Helper function that completes the feedback for two students.


test_get_responses_analysis_anonymous()   X-Ref
Test get_responses_analysis for anonymous feedback.


test_get_responses_analysis_non_anonymous()   X-Ref
Test get_responses_analysis for non-anonymous feedback.


test_get_last_completed_anonymous_not_completed()   X-Ref
Test get_last_completed for feedback anonymous not completed.


test_get_last_completed_anonymous_completed()   X-Ref
Test get_last_completed for feedback anonymous and completed.


test_get_last_completed_not_anonymous_completed()   X-Ref
Test get_last_completed for feedback not anonymous and completed.


test_get_last_completed_not_anonymous_not_completed()   X-Ref
Test get_last_completed for feedback not anonymous and not completed.


test_get_feedback_access_information_for_site_feedback()   X-Ref
Test get_feedback_access_information for site feedback.


test_get_feedback_access_information_for_site_feedback_mapped()   X-Ref
Test get_feedback_access_information for site feedback mapped.