Search moodle.org's
Developer Documentation

See Release Notes

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

(no description)

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

Defines 1 class


Class: preset_importer_test  - X-Ref

Preset importer tests class for mod_data.

preset_importer_provider()   X-Ref
Data provider for build providers for test_needs_mapping and test_set_affected_fields.

return: array[]

needs_mapping_provider()   X-Ref
Data provider for needs_mapping().

return: array[]

test_needs_mapping(array $currentfields,array $newfields,string $pluginname,bool $expectedresult)   X-Ref
Test for needs_mapping method.

param: array $currentfields Fields of the current activity.
param: array $newfields Fields to be imported.
param: string $pluginname The plugin preset to be imported.
param: bool $expectedresult Expected exception.

set_affected_provider()   X-Ref
Data provider for test_set_affected_fields().

return: array[]

test_set_affected_fields(array $currentfields,array $newfields,string $pluginname,int $fieldstocreate,int $fieldstoremove,int $fieldstoupdate)   X-Ref
Test for set_affected_fields method.

param: array $currentfields Fields of the current activity.
param: array $newfields Fields to be imported.
param: string $pluginname The plugin preset to be imported.
param: int $fieldstocreate Expected number of fields on $fieldstocreate.
param: int $fieldstoremove Expected number of fields on $fieldstoremove.
param: int $fieldstoupdate Expected number of fields on $fieldstoupdate.

test_get_mapping_information(array $currentfields,array $newfields,string $pluginname,int $fieldstocreate,int $fieldstoremove,int $fieldstoupdate)   X-Ref
Test for get_mapping_information method.

param: array $currentfields Fields of the current activity.
param: array $newfields Fields to be imported.
param: string $pluginname The plugin preset to be imported.
param: int $fieldstocreate Expected number of fields on $fieldstocreate.
param: int $fieldstoremove Expected number of fields on $fieldstoremove.
param: int $fieldstoupdate Expected number of fields on $fieldstoupdate.

get_field_names_provider()   X-Ref
Data provider for get_field_names().

return: array[]

test_get_field_names(array $fields, string $expected)   X-Ref
Test for get_field_names method.

param: array $fields List of fields to get the names from.
param: string $expected The list of field names expected.

test_create_from_plugin_or_directory()   X-Ref
Test for create_from_plugin_or_directory creation static method.