Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 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 39 and 310] [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

Unit tests for badges

Author: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
Copyright: 2013 onwards Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1016 lines (48 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: core_badges_badgeslib_testcase  - X-Ref

setUp()   X-Ref
No description

test_create_badge()   X-Ref
No description

test_clone_badge()   X-Ref
No description

test_badge_status()   X-Ref
No description

test_delete_badge()   X-Ref
No description

test_delete_badge_for_real()   X-Ref
Really delete the badge.


test_create_badge_criteria()   X-Ref
No description

test_add_badge_criteria_description()   X-Ref
No description

test_delete_badge_criteria()   X-Ref
No description

test_badge_awards()   X-Ref
No description

test_badges_get_user_badges()   X-Ref
Test the {@link badges_get_user_badges()} function in lib/badgeslib.php


data_for_message_from_template()   X-Ref
No description

test_badge_message_from_template($message, $params, $result)   X-Ref


test_badges_observer_course_module_criteria_review()   X-Ref
Test badges observer when course module completion event id fired.


test_badges_observer_course_criteria_review()   X-Ref
Test badges observer when course_completed event is fired.


test_badges_observer_profile_criteria_review()   X-Ref
Test badges observer when user_updated event is fired.


test_badges_observer_any_cohort_criteria_review()   X-Ref
Test badges observer when cohort_member_added event is fired and user required to belong to any cohort.


test_badges_observer_all_cohort_criteria_review()   X-Ref
Test badges observer when cohort_member_added event is fired and user required to belong to multiple (all) cohorts.


test_badges_assertion()   X-Ref
Test badges assertion generated when a badge is issued.


test_core_badges_myprofile_navigation()   X-Ref
Tests the core_badges_myprofile_navigation() function.


test_core_badges_myprofile_navigation_badges_disabled()   X-Ref
Tests the core_badges_myprofile_navigation() function with badges disabled..


test_core_badges_myprofile_navigation_with_course_badge()   X-Ref
Tests the core_badges_myprofile_navigation() function with a course badge.


test_badge_endorsement()   X-Ref
Test insert and update endorsement with a site badge.


test_badge_related()   X-Ref
Test insert and delete related badge with a site badge.


test_alignments()   X-Ref
Test insert, update, delete alignment with a site badge.


test_badges_delete_site_backpack()   X-Ref
Test badges_delete_site_backpack().