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.

(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.