Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

(no description)

File Size: 208 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

activitybadge_test:: (3 methods):
  test_activitybadge_export_for_template()
  setup_scenario()
  check_activitybadge()


Class: activitybadge_test  - X-Ref

Tests for activitybadge class.

test_activitybadge_export_for_template()   X-Ref
Test the behaviour of create_instance() and export_for_template() attributes.


setup_scenario()   X-Ref
Setup the default scenario, creating some activities:
- A forum with one unread message from the teacher.
- Another forum without unread messages.
- A file with all the appearance options enabled.
- A file with the "Show type" option disabled.
- An assignment.
- A label.

return: stdClass the scenario instances.

check_activitybadge(stdClass $result,?string $content = null,?string $style = null,?string $url = null,?string $elementid = null,?array $extra = null)   X-Ref
Method to check if the result of the export_from_template is the expected.

param: stdClass $result The result of the export_from_template() call.
param: string|null $content The expected activitybadge content.
param: string|null $style The expected activitybadge style.
param: string|null $url The expected activitybadge url.
param: string|null $elementid The expected activitybadge element id.
param: array|null $extra The expected activitybadge extra attributes.