Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core_xapi\test_helper Class Reference

Contains helper functions for xAPI PHPUnit Tests. More...

Public Member Functions

 get_last_log_entry ()
 Return the last log entry from standardlog.
 
 init_log ()
 Constructor for a xAPI test helper.
 

Static Public Member Functions

static create_state (array $info=[], bool $createindatabase=false)
 Return a valid state object with the params passed.
 

Detailed Description

Contains helper functions for xAPI PHPUnit Tests.

Since
Moodle 3.9
License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ create_state()

static core_xapi\test_helper::create_state ( array $info = [],
bool $createindatabase = false )
static

Return a valid state object with the params passed.

All tests are based on craft different types of states. This function is made to prevent redundant code on the test.

Parameters
array$infoarray of overriden state data (default []).
bool$createindatabaseWhether the state object should be created in database too or not.
Return values
statethe resulting state

◆ get_last_log_entry()

core_xapi\test_helper::get_last_log_entry ( )

Return the last log entry from standardlog.

Return values
core\event\base|nullThe last log event or null if none found.

The documentation for this class was generated from the following file: