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: 139 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

iri_test:: (6 methods):
  setupBeforeClass()
  test_generate()
  test_extract()
  iri_samples_provider()
  test_check()
  iri_check_provider()


Class: iri_test  - X-Ref

Contains test cases for testing xAPI iri class.

setupBeforeClass()   X-Ref
Setup to ensure that fixtures are loaded.


test_generate(string $value, string $expected, string $type = null)   X-Ref
Test IRI generation.

param: string $value Value to generate IRI
param: string $expected Expected result
param: string $type = null If some special type is provided

test_extract(string $expected, string $value, string $type = null)   X-Ref
Test IRI extraction.

param: string $expected Expected result
param: string $value Value to generate IRI
param: string $type = null If some special type is provided

iri_samples_provider()   X-Ref
Data provider for the test_generate and test_extract tests.

return: array

test_check(string $value, bool $expected)   X-Ref
Test IRI generation.

param: string $value Value to generate IRI
param: bool $expected Expected result

iri_check_provider()   X-Ref
Data provider for the test_check.

return: array