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

Defines 2 classes

delete_states_test:: (4 methods):
  setUpBeforeClass()
  test_component_names()
  execute()
  get_external_class()

extends:: (5 methods):
  validate_component()
  components_provider()
  test_invalid_agent()
  test_delete_states()
  states_provider()


Class: delete_states_test  - X-Ref

Unit tests for xAPI delete states webservice.

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


test_component_names(string $component, ?object $expected)   X-Ref
Testing different component names on valid states.

param: string $component component name
param: object|null $expected expected results

execute(string $component,string $activityiri,string $agent,?string $registration = null)   X-Ref
This function execute the delete_states_data

param: string $component component name
param: string $activityiri
param: string $agent
param: string|null $registration
return: array empty array

get_external_class()   X-Ref
Return a xAPI external webservice class to operate.

The test needs to fake a component in order to test without
using a real one. This way if in the future any component
implement it's xAPI handler this test will continue working.

return: delete_states the external class

Class: extends  - X-Ref

validate_component(string $component)   X-Ref
Method to override validate_component.

param: string $component The component name in frankenstyle.

components_provider()   X-Ref
Data provider for the test_component_names tests.

return: array

test_invalid_agent()   X-Ref
Testing invalid agent.


test_delete_states(string $testedusername,string $testedcomponent,string $testedactivityname,array $states,array $expectedstates)   X-Ref
Testing deleting states

param: string $testedusername
param: string $testedcomponent
param: string $testedactivityname
param: array $states
param: array $expectedstates
return: void

states_provider()   X-Ref
Data provider for the test_get_state tests.

return: array