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 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

API tests.

Copyright: 2015 Frédéric Massart - FMCorz.net
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 4672 lines (233 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

core_competency_api_testcase:: (82 methods):
  test_get_framework_related_contexts()
  test_get_framework_related_contexts_with_capabilities()
  test_get_template_related_contexts()
  test_get_template_related_contexts_with_capabilities()
  test_update_template()
  test_list_frameworks()
  test_duplicate_framework()
  test_update_plan()
  test_create_plan_from_template()
  test_update_plan_based_on_template()
  test_unlink_plan_from_template()
  test_update_template_updates_plans()
  test_complete_plan()
  setup_workflow_data()
  test_plan_request_review()
  test_plan_cancel_review_request()
  test_plan_start_review()
  test_plan_stop_review()
  test_approve_plan()
  test_unapprove_plan()
  test_update_plan_manage_archived_competencies()
  test_complete_plan_doesnot_change_order()
  test_delete_plan_manage_archived_competencies()
  test_list_plan_competencies_manage_archived_competencies()
  test_create_template_cohort()
  test_create_template_cohort_permissions()
  test_reorder_template_competencies_permissions()
  test_delete_template()
  test_delete_template_cohort()
  test_add_evidence_log()
  test_add_evidence_complete()
  test_add_evidence_override()
  test_add_evidence_and_send_for_review()
  test_add_evidence_existing_user_competency()
  test_add_evidence_no_existing_user_competency()
  test_add_evidence_applies_competency_rules()
  test_add_evidence_for_user_competency_course_grade_outside_course()
  test_add_evidence_user_competency_course_grade_in_course()
  test_observe_course_completed()
  test_list_evidence_in_course()
  test_list_course_modules_using_competency()
  test_set_ruleoutcome_course_competency()
  test_validate_grade_in_user_competency()
  test_hidden_framework()
  test_hidden_template()
  test_completed_plan_doesnot_change()
  setup_framework_for_reset_rules_tests()
  test_moving_competency_reset_rules_updown()
  test_moving_competency_reset_rules_parent()
  test_moving_competency_reset_rules_totoplevel()
  test_moving_competency_reset_rules_fromtoplevel()
  test_moving_competency_reset_rules_child()
  test_create_competency_reset_rules()
  test_delete_competency_reset_rules()
  test_template_has_related_data()
  test_delete_template_delete_plans()
  test_delete_template_unlink_plans()
  test_delete_competency()
  test_delete_competency_used_in_plan()
  test_delete_competency_used_in_usercompetency()
  test_delete_competency_used_in_usercompetencyplan()
  test_delete_competency_used_in_template()
  test_delete_competency_used_in_course()
  test_delete_framework()
  test_delete_framework_competency_used_in_plan()
  test_delete_framework_competency_used_in_usercompetency()
  test_delete_framework_competency_used_in_usercompetencyplan()
  test_delete_framework_competency_used_in_template()
  test_delete_framework_competency_used_in_course()
  test_grade_competency_in_course_permissions()
  assertSuccessWithGradeCompetencyInCourse()
  assertExceptionWithGradeCompetencyInCourse()
  test_list_evidence()
  test_get_user_competency_in_course()
  test_course_statistics()
  test_template_statistics()
  test_is_scale_used_anywhere()
  test_delete_evidence()
  test_delete_evidence_without_permissions()
  test_list_plans_to_review()
  test_list_user_competencies_to_review()
  test_list_plans_with_competency()


Class: core_competency_api_testcase  - X-Ref

API tests.

test_get_framework_related_contexts()   X-Ref
No description

test_get_framework_related_contexts_with_capabilities()   X-Ref
No description

test_get_template_related_contexts()   X-Ref
No description

test_get_template_related_contexts_with_capabilities()   X-Ref
No description

test_update_template()   X-Ref
Test updating a template.


test_list_frameworks()   X-Ref
Test listing framework with order param.


test_duplicate_framework()   X-Ref
Test duplicate a framework.


test_update_plan()   X-Ref
Test update plan.


test_create_plan_from_template()   X-Ref
No description

test_update_plan_based_on_template()   X-Ref
No description

test_unlink_plan_from_template()   X-Ref
No description

test_update_template_updates_plans()   X-Ref
No description

test_complete_plan()   X-Ref
Test that the method to complete a plan.


setup_workflow_data()   X-Ref
Set-up the workflow data (review, active, ...).

return: array

test_plan_request_review()   X-Ref
Testing requesting the review of a plan.


test_plan_cancel_review_request()   X-Ref
Testing cancelling the review request.


test_plan_start_review()   X-Ref
Testing starting the review.


test_plan_stop_review()   X-Ref
Testing stopping the review.


test_approve_plan()   X-Ref
Testing approving the plan.


test_unapprove_plan()   X-Ref
Testing stopping the review.


test_update_plan_manage_archived_competencies()   X-Ref
Test update plan and the managing of archived user competencies.


test_complete_plan_doesnot_change_order()   X-Ref
Test completing plan does not change the order of competencies.


test_delete_plan_manage_archived_competencies()   X-Ref
Test remove plan and the managing of archived user competencies.


test_list_plan_competencies_manage_archived_competencies()   X-Ref
Test listing of plan competencies.


test_create_template_cohort()   X-Ref
No description

test_create_template_cohort_permissions()   X-Ref
No description

test_reorder_template_competencies_permissions()   X-Ref
No description

test_delete_template()   X-Ref
No description

test_delete_template_cohort()   X-Ref
No description

test_add_evidence_log()   X-Ref
No description

test_add_evidence_complete()   X-Ref
No description

test_add_evidence_override()   X-Ref
No description

test_add_evidence_and_send_for_review()   X-Ref
No description

test_add_evidence_existing_user_competency()   X-Ref
Test add evidence for existing user_competency.


test_add_evidence_no_existing_user_competency()   X-Ref
Test add evidence for non-existing user_competency.


test_add_evidence_applies_competency_rules()   X-Ref
No description

test_add_evidence_for_user_competency_course_grade_outside_course()   X-Ref
Tests for the user_competency_course data when api::add_evidence() is invoked when
grading a user competency in the system context.


test_add_evidence_user_competency_course_grade_in_course()   X-Ref
Tests for the user_competency_course data when api::add_evidence() is invoked when
grading a user competency in a course.


test_observe_course_completed()   X-Ref
No description

test_list_evidence_in_course()   X-Ref
No description

test_list_course_modules_using_competency()   X-Ref
No description

test_set_ruleoutcome_course_competency()   X-Ref
Test update ruleoutcome for course_competency.


test_validate_grade_in_user_competency()   X-Ref
Test validation on grade on user_competency.


test_hidden_framework()   X-Ref
Test when adding competency that belong to hidden framework to plan/template/course.


test_hidden_template()   X-Ref
Test when using hidden template in plan/cohort.


test_completed_plan_doesnot_change()   X-Ref
Test that completed plan created form a template does not change when template is modified.


setup_framework_for_reset_rules_tests()   X-Ref
No description

test_moving_competency_reset_rules_updown()   X-Ref
No description

test_moving_competency_reset_rules_parent()   X-Ref
No description

test_moving_competency_reset_rules_totoplevel()   X-Ref
No description

test_moving_competency_reset_rules_fromtoplevel()   X-Ref
No description

test_moving_competency_reset_rules_child()   X-Ref
No description

test_create_competency_reset_rules()   X-Ref
No description

test_delete_competency_reset_rules()   X-Ref
No description

test_template_has_related_data()   X-Ref
No description

test_delete_template_delete_plans()   X-Ref
No description

test_delete_template_unlink_plans()   X-Ref
No description

test_delete_competency()   X-Ref
No description

test_delete_competency_used_in_plan()   X-Ref
No description

test_delete_competency_used_in_usercompetency()   X-Ref
No description

test_delete_competency_used_in_usercompetencyplan()   X-Ref
No description

test_delete_competency_used_in_template()   X-Ref
No description

test_delete_competency_used_in_course()   X-Ref
No description

test_delete_framework()   X-Ref
No description

test_delete_framework_competency_used_in_plan()   X-Ref
No description

test_delete_framework_competency_used_in_usercompetency()   X-Ref
No description

test_delete_framework_competency_used_in_usercompetencyplan()   X-Ref
No description

test_delete_framework_competency_used_in_template()   X-Ref
No description

test_delete_framework_competency_used_in_course()   X-Ref
No description

test_grade_competency_in_course_permissions()   X-Ref
No description

assertSuccessWithGradeCompetencyInCourse($courseid, $userid, $compid, $grade = 1)   X-Ref
Assert that a competency was graded in a course.

param: int $courseid The course ID.
param: int $userid The user ID.
param: int $compid The competency ID.
param: int $grade The grade.

assertExceptionWithGradeCompetencyInCourse($exceptiontype, $exceptiontext, $courseid, $userid, $compid,$grade = 1)   X-Ref
Assert that grading a competency in course throws an exception.

param: string $exceptiontype The exception type.
param: string $exceptiontest The exceptiont text.
param: int $courseid The course ID.
param: int $userid The user ID.
param: int $compid The competency ID.
param: int $grade The grade.

test_list_evidence()   X-Ref
Test list of evidences for plan completed and not completed.


test_get_user_competency_in_course()   X-Ref
Get a user competency in a course.


test_course_statistics()   X-Ref
Test course statistics api functions.


test_template_statistics()   X-Ref
Test template statistics api functions.


test_is_scale_used_anywhere()   X-Ref
No description

test_delete_evidence()   X-Ref
No description

test_delete_evidence_without_permissions()   X-Ref
No description

test_list_plans_to_review()   X-Ref
No description

test_list_user_competencies_to_review()   X-Ref
No description

test_list_plans_with_competency()   X-Ref
Test we can get all of a users plans with a competency.