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 310 and 401] [Versions 39 and 401]

This file contains unit test related to xAPI library.

Copyright: 2020 Ferran Recio
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 253 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: item_agent_test  - X-Ref

Contains test cases for testing statement agent class.

test_create()   X-Ref
Test item creation.


test_create_from_user()   X-Ref
Test item creation from Record.


test_invalid_data(string $objecttype, bool $validhome, bool $validid)   X-Ref
Test for invalid structures.

param: string $objecttype object type attribute
param: bool $validhome if valid homepage is user
param: bool $validid if valid group id is used

invalid_data_provider()   X-Ref
Data provider for the test_invalid_data tests.

return: array

test_unspupported_create(bool $usembox, bool $useaccount, bool $usesha1, bool $useopenid)   X-Ref
Test non supported account identifier xAPI formats.

param: bool $usembox
param: bool $useaccount
param: bool $usesha1
param: bool $useopenid

unspupported_create_provider()   X-Ref
Data provider for the unsupported identifiers tests.

return: array

test_missing_object_type()   X-Ref
Test for missing object type.


test_inexistent_agent()   X-Ref
Test for invalid user id.


test_inexistent_agent_id()   X-Ref
Test for invalid agent record.